mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-07-17 16:38:18 +00:00
feature(cloudcmd) NODE_ENV: debug -> development
This commit is contained in:
parent
56882ee489
commit
efb381eb97
4 changed files with 15 additions and 15 deletions
|
|
@ -7,16 +7,16 @@ const dir = './client';
|
|||
const dirExternal = './node_modules';
|
||||
|
||||
const {env} = process;
|
||||
const isDebug = env.NODE_ENV === 'debug';
|
||||
const isDev = env.NODE_ENV === 'development';
|
||||
|
||||
const dist = path.resolve(__dirname, 'dist');
|
||||
const distDebug = path.resolve(__dirname, 'dist-debug');
|
||||
const devtool = isDebug ? 'eval' : 'source-map';
|
||||
const distDev = path.resolve(__dirname, 'dist-dev');
|
||||
const devtool = isDev ? 'eval' : 'source-map';
|
||||
const notEmpty = (a) => a;
|
||||
const clean = (array) => array.filter(notEmpty);
|
||||
|
||||
const plugins = clean([
|
||||
!isDebug && new UglifyJsPlugin({
|
||||
!isDev && new UglifyJsPlugin({
|
||||
sourceMap: true
|
||||
}),
|
||||
new webpack.optimize.CommonsChunkPlugin({
|
||||
|
|
@ -47,7 +47,7 @@ module.exports = {
|
|||
},
|
||||
output: {
|
||||
filename: '[name].js',
|
||||
path: isDebug ? distDebug : dist,
|
||||
path: isDev ? distDev : dist,
|
||||
libraryTarget: 'umd'
|
||||
},
|
||||
plugins,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue