Skip to content

Commit

Permalink
Fixed output of production build
Browse files Browse the repository at this point in the history
  • Loading branch information
Marcos Mellado committed Jul 10, 2017
1 parent b99b5d8 commit d4d0154
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion bin/tiny-react-spa.js
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
8 changes: 8 additions & 0 deletions out/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand Down

0 comments on commit d4d0154

Please sign in to comment.