2021-09-07 17:31:46 -03:00
|
|
|
const path = require('path');
|
|
|
|
const { CleanWebpackPlugin } = require('clean-webpack-plugin');
|
2021-09-23 17:51:24 -03:00
|
|
|
const HtmlWebpackPlugin = require('html-webpack-plugin');
|
2021-12-02 00:41:56 +00:00
|
|
|
const CopyPlugin = require('copy-webpack-plugin');
|
2021-12-21 20:53:30 -08:00
|
|
|
const { merge } = require('webpack-merge');
|
2022-01-24 11:24:16 -08:00
|
|
|
const common = require('./webpack.common');
|
2021-09-07 17:31:46 -03:00
|
|
|
|
2021-12-21 20:53:30 -08:00
|
|
|
const playgroundConfig = {
|
2022-01-05 18:02:55 -08:00
|
|
|
mode: 'development',
|
2021-10-04 17:38:11 -07:00
|
|
|
entry: {
|
2021-12-02 00:41:56 +00:00
|
|
|
layout: path.resolve(__dirname, './test/playground/layout/context-loader'),
|
2021-10-04 17:38:11 -07:00
|
|
|
},
|
2022-01-26 15:17:43 -03:00
|
|
|
output: {
|
|
|
|
path: path.resolve(__dirname, 'test/playground/dist'),
|
|
|
|
filename: '[name].js',
|
|
|
|
library: {
|
|
|
|
type: 'umd',
|
|
|
|
},
|
|
|
|
},
|
2021-12-02 00:41:56 +00:00
|
|
|
devServer: {
|
|
|
|
historyApiFallback: true,
|
2022-01-24 17:22:39 -03:00
|
|
|
port: 8083,
|
2022-08-26 01:35:59 +00:00
|
|
|
open: false
|
2021-10-04 17:38:11 -07:00
|
|
|
},
|
|
|
|
plugins: [
|
|
|
|
new CleanWebpackPlugin(),
|
2021-12-02 00:41:56 +00:00
|
|
|
new CopyPlugin({
|
|
|
|
patterns: [
|
|
|
|
{ from: 'test/playground/index.html', to: 'index.html' },
|
|
|
|
],
|
2021-10-04 17:38:11 -07:00
|
|
|
}),
|
|
|
|
new HtmlWebpackPlugin({
|
|
|
|
chunks: ['layout'],
|
2021-12-02 00:41:56 +00:00
|
|
|
filename: 'layout.html',
|
|
|
|
template: 'test/playground/layout/index.html',
|
|
|
|
}),
|
2021-10-04 17:38:11 -07:00
|
|
|
],
|
2021-09-07 17:31:46 -03:00
|
|
|
};
|
2021-12-21 20:53:30 -08:00
|
|
|
|
|
|
|
module.exports = merge(common, playgroundConfig);
|