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({
|
new WorkboxPlugin.InjectManifest({
|
||||||
swSrc: path.resolve(path.join('src', 'service-worker.js')),
|
swSrc: path.resolve(path.join('src', 'service-worker.js')),
|
||||||
swDest: 'memories-service-worker.js',
|
swDest: 'memories-service-worker.js',
|
||||||
})
|
}),
|
||||||
);
|
);
|
||||||
|
|
||||||
// Exclusions from minification
|
// Minification
|
||||||
const minifyExclude = [/filerobot-image-editor/];
|
webpackConfig.optimization.minimizer = [
|
||||||
|
new TerserPlugin({
|
||||||
webpackConfig.optimization.minimizer[0] = new TerserPlugin({
|
exclude: [/filerobot-image-editor/],
|
||||||
exclude: minifyExclude,
|
|
||||||
terserOptions: {
|
terserOptions: {
|
||||||
output: {
|
output: {
|
||||||
comments: false,
|
comments: false,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
extractComments: true,
|
extractComments: true,
|
||||||
});
|
}),
|
||||||
|
];
|
||||||
|
|
||||||
// Disable source maps in production
|
// Disable source maps in production
|
||||||
webpackConfig.devtool = isDev ? 'cheap-source-map' : false;
|
webpackConfig.devtool = isDev ? 'cheap-source-map' : false;
|
||||||
|
@ -62,7 +62,7 @@ webpackConfig.plugins.push(
|
||||||
new webpack.SourceMapDevToolPlugin({
|
new webpack.SourceMapDevToolPlugin({
|
||||||
filename: '[file].map',
|
filename: '[file].map',
|
||||||
publicPath: path.join('/apps/', process.env.npm_package_name, '/js/'),
|
publicPath: path.join('/apps/', process.env.npm_package_name, '/js/'),
|
||||||
})
|
}),
|
||||||
);
|
);
|
||||||
|
|
||||||
// Enable caching
|
// Enable caching
|
||||||
|
|
Loading…
Reference in New Issue