Omtimize playground load time

This commit is contained in:
Paulo Gustavo Veiga 2022-01-05 18:02:55 -08:00
parent 60ee365171
commit 80ba74b981
3 changed files with 2 additions and 9 deletions

View File

@ -9,9 +9,6 @@ module.exports = {
type: 'umd', type: 'umd',
}, },
}, },
optimization: {
usedExports: true,
},
entry: { entry: {
mindplot: './src/index.js', mindplot: './src/index.js',
loader: './src/indexLoader.js', loader: './src/indexLoader.js',

View File

@ -6,6 +6,7 @@ const common = require('./webpack.common');
const { merge } = require('webpack-merge'); const { merge } = require('webpack-merge');
const playgroundConfig = { const playgroundConfig = {
mode: 'development',
entry: { entry: {
layout: path.resolve(__dirname, './test/playground/layout/context-loader'), layout: path.resolve(__dirname, './test/playground/layout/context-loader'),
viewmode: path.resolve(__dirname, './test/playground/map-render/js/viewmode'), viewmode: path.resolve(__dirname, './test/playground/map-render/js/viewmode'),

View File

@ -1,16 +1,11 @@
const { merge } = require('webpack-merge'); const { merge } = require('webpack-merge');
const CompressionPlugin = require('compression-webpack-plugin');
const common = require('./webpack.common'); const common = require('./webpack.common');
const prodConfig = { const prodConfig = {
optimization: { optimization: {
usedExports: true,
minimize: true, minimize: true,
}, },
plugins: [
new CompressionPlugin({
test: /\.js(\?.*)?$/i,
}),
],
}; };
module.exports = merge(common, prodConfig); module.exports = merge(common, prodConfig);