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

48 lines
1.2 KiB
JavaScript
Raw Normal View History

2021-09-07 22:31:46 +02:00
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');
2021-09-07 22:31:46 +02:00
const playgroundConfig = {
2022-01-06 03:02:55 +01:00
mode: 'development',
2021-10-05 02:38:11 +02:00
entry: {
2022-01-25 15:10:00 +01:00
mindplot: path.resolve(__dirname, './src/index.js'),
layout: path.resolve(__dirname, './test/playground/layout/context-loader'),
2021-10-05 02:38:11 +02:00
},
devServer: {
historyApiFallback: true,
port: 8083,
open: false,
2022-01-25 15:10:00 +01:00
writeToDisk: true,
},
2021-10-05 02:38:11 +02:00
module: {
rules: [
{
2022-01-11 06:18:45 +01:00
test: /\.css$/i,
use: [
'style-loader',
'css-loader?url=false',
],
},
],
2021-10-05 02:38:11 +02:00
},
plugins: [
new CleanWebpackPlugin(),
new CopyPlugin({
patterns: [
2021-12-24 20:04:50 +01:00
{ from: '../../libraries/bootstrap', to: 'bootstrap' },
{ from: 'test/playground/index.html', to: 'index.html' },
],
2021-10-05 02:38:11 +02:00
}),
new HtmlWebpackPlugin({
chunks: ['layout'],
filename: 'layout.html',
template: 'test/playground/layout/index.html',
}),
2021-10-05 02:38:11 +02:00
],
2021-09-07 22:31:46 +02:00
};
module.exports = merge(common, playgroundConfig);