prestarocket-agence / classic-rocket

Classic Rocket is a rework of "classic theme". It has been built keeping in mind : performance, accessibility and SEO.
https://demoprestashop.prestarocket.com/
Other
230 stars 127 forks source link

Watch compiles for production #148

Closed dangelion closed 4 years ago

dangelion commented 4 years ago

While developing with npm run watch I noticed it compiles for production (minify JS, removes console.log, etc) while it shouldn't. Also npm run build shouldn't compiles for production. You should add another command npm run prod to do that. Any help to achieve that?

prestancedesign commented 4 years ago

Hi @dangelion

You must add the condition against production env var like this:

if (process.env.NODE_ENV === 'production') {
    config.plugins.push(
...

You can check the classic theme webpack config file: https://github.com/PrestaShop/PrestaShop/blob/develop/themes/classic/_dev/webpack.config.js#L89