webpack-blocks-utils
v1.3.1
Published
Tiny webpack-blocks helpers
Downloads
28
Readme
webpack-blocks-utils
Tiny helpers for webpack-blocks.
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.