wisemapping-frontend/packages/mindplot/webpack.playground.js

47 lines
1.2 KiB
JavaScript
Raw Normal View History

2021-09-07 17:31:46 -03:00
const path = require('path');
const { CleanWebpackPlugin } = require('clean-webpack-plugin');
const HtmlWebpackPlugin = require('html-webpack-plugin');
2021-09-07 17:31:46 -03:00
/** @type {import('webpack').Configuration} */
module.exports = {
2021-09-08 17:45:26 -03:00
entry: {
2021-10-03 08:18:48 -07:00
layout: path.resolve(__dirname, './test/playground/context-loader'),
2021-09-08 17:45:26 -03:00
},
2021-09-07 17:31:46 -03:00
output: {
path: path.resolve(__dirname, 'dist', 'test'),
filename: '[name].test.js',
2021-09-07 17:31:46 -03:00
publicPath: '',
},
mode: 'production',
2021-09-02 13:32:23 -03:00
optimization: {
splitChunks: {
chunks: 'all',
minSize: 2000000,
},
},
devtool: 'source-map',
2021-09-07 17:31:46 -03:00
module: {
rules: [
{
use: 'babel-loader',
test: /.(js|jsx)$/,
exclude: /node_modules/,
2021-10-03 08:18:48 -07:00
}
2021-09-07 17:31:46 -03:00
],
},
resolve: {
2021-10-03 08:18:48 -07:00
extensions: ['.js','.json'],
2021-09-07 17:31:46 -03:00
},
plugins: [
new CleanWebpackPlugin(),
new HtmlWebpackPlugin({
2021-10-02 18:37:42 -07:00
template: 'test/playground/index.html',
}),
new HtmlWebpackPlugin({
chunks: ['layout'],
filename: 'layout',
2021-10-02 18:37:42 -07:00
template: 'test/playground/layout.html',
}),
],
2021-09-07 17:31:46 -03:00
};