build(ui): temporarily disable source maps for production
Due to bloating of the production builds. We may consider some more optimised ways of adding these
back in future as they are very useful for production reporting and debugging.
const path = require('path');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const CopyPlugin = require('copy-webpack-plugin');
-const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin;
-module.exports = {
+module.exports = (env, argv) => {
+ return {
mode: 'development',
entry: {
main: './plugins/api-manager/ts/apimanPlugin.ts'
},
- devtool: 'inline-source-map',
+ devtool: argv.mode === 'development' ? 'source-map' : false,
devServer: {
port: 2772,
static: './dist',
@@ -29,8 +29,7 @@ module.exports = {
},
}
],
- }),
- new BundleAnalyzerPlugin()
+ })
],
module: {
rules: [
@@ -65,4 +64,5 @@ module.exports = {
path: path.resolve(__dirname, 'dist'),
clean: true
}
+ }
};
\ No newline at end of file
