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

66 lines
2.1 KiB
JavaScript
Raw Permalink Normal View History

2022-01-25 19:10:40 +01: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');
const playgroundConfig = {
mode: 'development',
entry: {
viewmode: path.resolve(__dirname, './test/playground/map-render/js/viewmode'),
editor: path.resolve(__dirname, './test/playground/map-render/js/editor'),
showcase: path.resolve(__dirname, './test/playground/map-render/js/showcase'),
editorlocked: path.resolve(__dirname, './test/playground/map-render/js/editorlocked'),
2022-01-25 19:10:40 +01:00
},
output: {
2022-01-26 20:25:11 +01:00
path: path.resolve(__dirname, 'test/playground/dist'),
2022-01-25 19:10:40 +01:00
filename: '[name].js',
library: {
type: 'umd',
},
},
devServer: {
historyApiFallback: true,
port: 8081,
open: false,
},
plugins: [
2022-01-31 22:07:59 +01:00
new CleanWebpackPlugin({
dangerouslyAllowCleanPatternsOutsideProject: true,
dry: false,
}),
2022-01-25 19:10:40 +01:00
new CopyPlugin({
patterns: [
{ from: 'test/playground/map-render/images/favicon.ico', to: 'favicon.ico' },
{ from: 'test/playground/map-render/images', to: 'images' },
{ from: 'test/playground/map-render/js', to: 'js' },
{ from: 'test/playground/map-render/samples', to: 'samples' },
{ from: 'test/playground/index.html', to: 'index.html' },
],
}),
new HtmlWebpackPlugin({
chunks: ['viewmode'],
filename: 'viewmode.html',
template: 'test/playground/map-render/html/viewmode.html',
}),
new HtmlWebpackPlugin({
2022-07-13 03:58:11 +02:00
chunks: ['editor'],
filename: 'editor.html',
template: 'test/playground/map-render/html/editor.html',
}),
new HtmlWebpackPlugin({
chunks: ['showcase'],
filename: 'showcase.html',
template: 'test/playground/map-render/html/showcase.html',
}),
new HtmlWebpackPlugin({
chunks: ['editorlocked'],
filename: 'editorlocked.html',
template: 'test/playground/map-render/html/editor.html',
}),
2022-07-13 03:58:11 +02:00
],
2022-01-25 19:10:40 +01:00
};
module.exports = merge(common, playgroundConfig);