mirror of
https://bitbucket.org/wisemapping/wisemapping-frontend.git
synced 2024-12-22 03:33:48 +01:00
Fix webpack.plaground to inherit from webpack.common
This commit is contained in:
parent
b29b75931e
commit
3ac1b939aa
@ -13,6 +13,8 @@ module.exports = {
|
||||
optimization: {
|
||||
usedExports: true,
|
||||
},
|
||||
mode: 'production',
|
||||
devtool: 'source-map',
|
||||
module: {
|
||||
rules: [
|
||||
{
|
||||
|
@ -10,7 +10,6 @@ const devConfig = {
|
||||
open: true,
|
||||
},
|
||||
plugins: [new HotModuleReplacementPlugin()],
|
||||
devtool: 'eval-source-map',
|
||||
};
|
||||
|
||||
module.exports = merge(common, devConfig);
|
||||
|
@ -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);
|
||||
|
@ -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({
|
||||
|
Loading…
Reference in New Issue
Block a user