Commit dd6f9e48 authored by NeOMakinG's avatar NeOMakinG
Browse files

Switch to terser on new-theme and use production mode

parent b9f3d3d3
const webpack = require('webpack');
const keepLicense = require('uglify-save-license');
const UglifyJsPlugin = require('uglifyjs-webpack-plugin');
const TerserPlugin = require('terser-webpack-plugin');
const common = require('./common.js');
/**
......@@ -12,17 +11,11 @@ function prodConfig() {
const prod = Object.assign(common, {
stats: 'minimal',
optimization: {
minimize: true,
minimizer: [
new UglifyJsPlugin({
sourceMap: false,
uglifyOptions: {
compress: {
drop_console: true,
},
output: {
comments: keepLicense,
},
},
new TerserPlugin({
parallel: true,
extractComments: /@license/i,
}),
],
},
......
......@@ -5,7 +5,7 @@
"private": "true",
"scripts": {
"test": "NODE_ENV=test ./node_modules/.bin/mocha --require babel-register --reporter spec \"tests/**/*.spec.js\"",
"build": "webpack --progress",
"build": "webpack --progress --mode=production",
"dev": "webpack --progress --watch --mode=development",
"watch": "npm run dev",
"lint": "eslint -c .eslintrc.js --ext .js,.vue .",
......@@ -92,8 +92,7 @@
"style-loader": "^1.1.3",
"stylelint": "^13.13.1",
"stylelint-config-prestashop": "^1.0.5",
"uglify-save-license": "^0.4.1",
"uglifyjs-webpack-plugin": "^2.2.0",
"terser-webpack-plugin": "^5.2.4",
"vue-loader": "^15.9.7",
"vue-style-loader": "^4.1.3",
"vue-template-compiler": "^2.6.12",
......
......@@ -32,4 +32,4 @@
const prod = require('./.webpack/prod.js');
const dev = require('./.webpack/dev.js');
module.exports = (env, argv) => (argv !== undefined && argv.mode === 'production' ? prod() : dev());
module.exports = (env, argv) => (argv !== undefined && (argv.mode === 'production' || !argv.mode) ? prod() : dev());
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment