Fix webpack.plaground to inherit from webpack.common

This commit is contained in:
Paulo Gustavo Veiga 2021-12-21 20:53:30 -08:00
parent b29b75931e
commit 3ac1b939aa
4 changed files with 7 additions and 40 deletions

View File

@ -13,6 +13,8 @@ module.exports = {
optimization: {
usedExports: true,
},
mode: 'production',
devtool: 'source-map',
module: {
rules: [
{

View File

@ -10,7 +10,6 @@ const devConfig = {
open: true,
},
plugins: [new HotModuleReplacementPlugin()],
devtool: 'eval-source-map',
};
module.exports = merge(common, devConfig);

View File

@ -2,42 +2,23 @@ const path = require('path');
const { CleanWebpackPlugin } = require('clean-webpack-plugin');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const CopyPlugin = require('copy-webpack-plugin');
const common = require('./webpack.common');
const { merge } = require('webpack-merge');
module.exports = {
const playgroundConfig = {
entry: {
layout: path.resolve(__dirname, './test/playground/layout/context-loader'),
viewmode: path.resolve(__dirname, './test/playground/map-render/js/viewmode'),
embedded: path.resolve(__dirname, './test/playground/map-render/js/embedded'),
editor: path.resolve(__dirname, './test/playground/map-render/js/editor'),
},
output: {
path: path.resolve(__dirname, 'dist', 'test'),
filename: '[name].test.js',
publicPath: '',
},
devServer: {
historyApiFallback: true,
port: 8081,
open: false,
},
mode: 'production',
optimization: {
splitChunks: {
chunks: 'all',
minSize: 2000000,
},
},
devtool: 'source-map',
module: {
rules: [
{
use: 'babel-loader',
test: /.js$/,
exclude: [
/node_modules/,
/lib\/raphael/ig,
],
},
{
test: /\.less$/i,
use: [
@ -47,19 +28,8 @@ module.exports = {
'less-loader',
],
},
{
test: /\.(png|svg|jpg|jpeg|gif)$/i,
type: 'asset/resource',
},
],
},
resolve: {
alias: {
'@libraries': path.resolve(__dirname, '../../libraries/'),
},
extensions: ['.js', '.json'],
},
plugins: [
new CleanWebpackPlugin(),
new CopyPlugin({
@ -97,3 +67,5 @@ module.exports = {
}),
],
};
module.exports = merge(common, playgroundConfig);

View File

@ -3,14 +3,8 @@ const CompressionPlugin = require('compression-webpack-plugin');
const common = require('./webpack.common');
const prodConfig = {
mode: 'production',
devtool: 'source-map',
optimization: {
minimize: true,
splitChunks: {
chunks: 'all',
minSize: 2000000,
},
},
plugins: [
new CompressionPlugin({