refactor: webpack config js

Signed-off-by: Varun Patil <radialapps@gmail.com>
pull/877/head
Varun Patil 2023-10-14 19:39:29 -07:00
parent eee5abf210
commit c1b2984e22
1 changed files with 13 additions and 13 deletions

View File

@ -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