webpack-blocks-utils

    1.3.1 • Public • Published

    webpack-blocks-utils

    Tiny helpers for webpack-blocks.

    JavaScript Style Guide NPM Version

    Installation

    yarn add --dev webpack-blocks-utils

    or

    npm install --save-dev webpack-blocks-utils

    Usage

    setTarget(target)

    Sets target

    Example usage:

    setTarget('electron-renderer')

    setNode(node)

    Sets node

    Example usage:

    setNode({
      __dirname: false,
      __filename: false,
    })

    setExternals(externals)

    Sets externals

    Example usage:

    setExternals(['firebase', 'electron-debug', 'debug'])

    envVar(key, value, configSetters)

    Applies an array of webpack blocks only if process.env[key] matches the given value.

    envVar('ELECTRON', 'true', [
      setTarget('electron-main'),
      setExternals(['firebase', 'electron-debug', 'debug']),
      // ...
    ]),

    noParse(regexes)

    Sets module.noParse

    Example usage:

    noParse([
      // Don't parse localforage because it's pre-built
      new RegExp('node_modules/localforage/dist/localforage.js'),
    ]),

    License

    This project is licensed under MIT.

    Install

    npm i webpack-blocks-utils

    DownloadsWeekly Downloads

    2

    Version

    1.3.1

    License

    MIT

    Last publish

    Collaborators

    • bkonkle
    • webyak
    • ecliptic-team