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({
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