wcf
Webpack configuration factory
Installation
npm install wcf --save
Example usage
const Webpack = const wcf = const target = processargv2 || 'web'const nodeEnv = processenvNODE_ENV || 'development'const prod = nodeEnv === 'production' const f = prodweb web node const webpackConfig = f consoledirwebpackConfig depth: null // $ node example.js web// { target: 'web',// devtool: 'source-map',// plugins: [ DefinePlugin { definitions: { 'process.env.NODE_ENV': '"development"' } } ] } // $ NODE_ENV=production node example.js web// { target: 'web',// devtool: 'hidden-source-map',// plugins: [ DefinePlugin { definitions: { 'process.env.NODE_ENV': '"production"' } } ] } // $ node example.js node// { target: 'node',// devtool: 'source-map',// plugins:// [ DefinePlugin {// definitions:// { ...// process.env.NODE_ENV: '"development"',// process.env.SECRET: '"supersecret"' } } ] }
License
MIT