Skip to content

Commit

Permalink
allow app to define terser options
Browse files Browse the repository at this point in the history
  • Loading branch information
William Welling committed Jul 21, 2022
1 parent 2aaaf76 commit d311293
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions cli/default-webpack.config.js
Expand Up @@ -7,16 +7,18 @@ const CopyPlugin = require("copy-webpack-plugin");
const TerserPlugin = require("terser-webpack-plugin");

let appBuildConfig = require(resolve(process.cwd(), '.wvr', 'build-config.js')).config;

appBuildConfig = !!appBuildConfig ? appBuildConfig : {
path: 'dist',
publicPath: '/',
copy: [],
entry: {},
terserOptions: {},
};

const extractLoader = extract.ExtractModuleToGlobal.loader;
const { path = 'dist', publicPath = '/', copy = [], entry = {}, terserOptions = {} } = appBuildConfig;

const { path, publicPath, copy, entry } = appBuildConfig;
const extractLoader = extract.ExtractModuleToGlobal.loader;

// prepare copy patterns to dist directory
const patterns = [];
Expand Down Expand Up @@ -100,13 +102,7 @@ module.exports = {
minimize: env === 'production',
minimizer: [new TerserPlugin(
{
terserOptions: {
ecma: 5,
parse: {},
compress: {},
mangle: false,
module: false
},
terserOptions,
}
)],
},
Expand Down

0 comments on commit d311293

Please sign in to comment.