Polyconseil / systematic

An opinionated ES6 toolchain for the browser.
25 stars 3 forks source link

webpack: use DefinePlugin to pass NODE_ENV to Uglify #70

Closed sebdiem closed 6 years ago

sebdiem commented 6 years ago

This commit fixes a regression introduced by cfaecf1e5c8955a197.

According to the webpack doc:

-p is equivalent to --optimize-minimize --define process.env.NODE_ENV="production"

Removing the -p had the effect of preventing UglifyJS from removing Vuejs dev mode logging. We for example had the following log in our production bundles:

You are running Vue in development mode.
Make sure to turn on production mode when deploying for production.
See more tips at https://vuejs.org/guide/deployment.html

The --define process.env.NODE_ENV="production" can be replaced by this commit (as advised by the vuejs official documentation).