refactor: webpack config js
Signed-off-by: Varun Patil <radialapps@gmail.com>pull/877/head
parent
eee5abf210
commit
c1b2984e22
16
webpack.js
16
webpack.js
|
@ -38,21 +38,21 @@ webpackConfig.plugins.push(
|
|||
new WorkboxPlugin.InjectManifest({
|
||||
swSrc: path.resolve(path.join('src', 'service-worker.js')),
|
||||
swDest: 'memories-service-worker.js',
|
||||
})
|
||||
}),
|
||||
);
|
||||
|
||||
// Exclusions from minification
|
||||
const minifyExclude = [/filerobot-image-editor/];
|
||||
|
||||
webpackConfig.optimization.minimizer[0] = new TerserPlugin({
|
||||
exclude: minifyExclude,
|
||||
// Minification
|
||||
webpackConfig.optimization.minimizer = [
|
||||
new TerserPlugin({
|
||||
exclude: [/filerobot-image-editor/],
|
||||
terserOptions: {
|
||||
output: {
|
||||
comments: false,
|
||||
},
|
||||
},
|
||||
extractComments: true,
|
||||
});
|
||||
}),
|
||||
];
|
||||
|
||||
// Disable source maps in production
|
||||
webpackConfig.devtool = isDev ? 'cheap-source-map' : false;
|
||||
|
@ -62,7 +62,7 @@ webpackConfig.plugins.push(
|
|||
new webpack.SourceMapDevToolPlugin({
|
||||
filename: '[file].map',
|
||||
publicPath: path.join('/apps/', process.env.npm_package_name, '/js/'),
|
||||
})
|
||||
}),
|
||||
);
|
||||
|
||||
// Enable caching
|
||||
|
|
Loading…
Reference in New Issue