2021-09-07 22:31:46 +02:00
|
|
|
const path = require('path');
|
|
|
|
const { CleanWebpackPlugin } = require('clean-webpack-plugin');
|
2021-09-23 22:51:24 +02:00
|
|
|
const HtmlWebpackPlugin = require('html-webpack-plugin');
|
2021-12-02 01:41:56 +01:00
|
|
|
const CopyPlugin = require('copy-webpack-plugin');
|
2021-12-22 05:53:30 +01:00
|
|
|
const { merge } = require('webpack-merge');
|
2022-01-24 20:24:16 +01:00
|
|
|
const common = require('./webpack.common');
|
2021-09-07 22:31:46 +02:00
|
|
|
|
2021-12-22 05:53:30 +01:00
|
|
|
const playgroundConfig = {
|
2022-01-06 03:02:55 +01:00
|
|
|
mode: 'development',
|
2021-10-05 02:38:11 +02:00
|
|
|
entry: {
|
2021-12-02 01:41:56 +01:00
|
|
|
layout: path.resolve(__dirname, './test/playground/layout/context-loader'),
|
2021-10-05 02:38:11 +02:00
|
|
|
},
|
2022-01-26 20:25:11 +01:00
|
|
|
output: {
|
|
|
|
path: path.resolve(__dirname, 'test/playground/dist'),
|
|
|
|
filename: '[name].js',
|
|
|
|
library: {
|
|
|
|
type: 'umd',
|
|
|
|
},
|
|
|
|
},
|
2021-12-02 01:41:56 +01:00
|
|
|
devServer: {
|
|
|
|
historyApiFallback: true,
|
2022-01-25 19:10:40 +01:00
|
|
|
port: 8083,
|
2021-12-02 01:41:56 +01:00
|
|
|
open: false,
|
|
|
|
},
|
2021-10-05 02:38:11 +02:00
|
|
|
module: {
|
|
|
|
rules: [
|
2021-12-13 22:30:37 +01:00
|
|
|
{
|
2022-01-11 06:18:45 +01:00
|
|
|
test: /\.css$/i,
|
2022-01-26 20:25:11 +01:00
|
|
|
use: ['style-loader', 'css-loader?url=false'],
|
2021-12-13 22:30:37 +01:00
|
|
|
},
|
2021-09-23 22:51:24 +02:00
|
|
|
],
|
2021-10-05 02:38:11 +02:00
|
|
|
},
|
|
|
|
plugins: [
|
|
|
|
new CleanWebpackPlugin(),
|
2021-12-02 01:41:56 +01:00
|
|
|
new CopyPlugin({
|
|
|
|
patterns: [
|
2021-12-24 20:04:50 +01:00
|
|
|
{ from: '../../libraries/bootstrap', to: 'bootstrap' },
|
2021-12-02 01:41:56 +01:00
|
|
|
{ from: 'test/playground/index.html', to: 'index.html' },
|
|
|
|
],
|
2021-10-05 02:38:11 +02:00
|
|
|
}),
|
|
|
|
new HtmlWebpackPlugin({
|
|
|
|
chunks: ['layout'],
|
2021-12-02 01:41:56 +01:00
|
|
|
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
|
|
|
};
|
2021-12-22 05:53:30 +01:00
|
|
|
|
|
|
|
module.exports = merge(common, playgroundConfig);
|