diff --git a/bin/tiny-react-spa.js b/bin/tiny-react-spa.js index 47c2940..c733620 100644 --- a/bin/tiny-react-spa.js +++ b/bin/tiny-react-spa.js @@ -45,7 +45,7 @@ var packageJSON = { "webpack-dev-server": "^2.5.0" }, "scripts": { - "start": "npm run clean && webpack && webpack-dev-server --hot --inline --open --content-base dist", + "start": "npm run clean && webpack && cross-env=development webpack-dev-server --hot --inline --open --content-base dist", "build": "npm run clean && cross-env NODE_ENV=production webpack", "clean": "rimraf dist", "lint": "eslint src", diff --git a/out/webpack.config.js b/out/webpack.config.js index 4ed7fa7..3454254 100644 --- a/out/webpack.config.js +++ b/out/webpack.config.js @@ -12,7 +12,15 @@ var webpackPlugins = [ ]; if (isProduction) { + // Production webpack plugins webpackPlugins.push(new webpack.optimize.UglifyJsPlugin({ compress: { warnings: false } })); + webpackPlugins.push(new webpack.DefinePlugin({ + 'process.env': { + NODE_ENV: JSON.stringify('production') + } + })); + + // Production babel plugins babelPlugins.push(["transform-react-remove-prop-types", { "mode": "wrap", "ignoreFilenames": ["node_modules"]