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

71 lines
2.3 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 = {
2021-10-05 02:38:11 +02:00
entry: {
layout: path.resolve(__dirname, './test/playground/layout/context-loader'),
viewmode: path.resolve(__dirname, './test/playground/map-render/js/viewmode'),
embedded: path.resolve(__dirname, './test/playground/map-render/js/embedded'),
2021-12-05 18:25:16 +01:00
editor: path.resolve(__dirname, './test/playground/map-render/js/editor'),
2021-10-05 02:38:11 +02:00
},
devServer: {
historyApiFallback: true,
port: 8081,
open: false,
},
2021-10-05 02:38:11 +02:00
module: {
rules: [
{
test: /\.less$/i,
use: [
// compiles Less to CSS
'style-loader',
'css-loader?url=false',
'less-loader',
],
},
],
2021-10-05 02:38:11 +02:00
},
plugins: [
new CleanWebpackPlugin(),
new CopyPlugin({
patterns: [
{ from: 'test/playground/map-render/images/favicon.ico', to: 'favicon.ico' },
{ from: 'test/playground/map-render/images', to: 'images' },
2021-12-05 18:25:16 +01:00
{ from: 'test/playground/map-render/js', to: 'js' },
{ from: 'test/playground/map-render/samples', to: 'samples' },
2021-12-24 20:04:50 +01:00
{ from: '../../libraries/bootstrap', to: 'bootstrap' },
{ from: 'test/playground/index.html', to: 'index.html' },
2021-12-05 18:25:16 +01:00
{ from: 'test/playground/map-render/html/container.json', to: 'html/container.json' },
{ from: 'test/playground/map-render/html/container.html', to: 'container.html' },
],
2021-10-05 02:38:11 +02:00
}),
new HtmlWebpackPlugin({
chunks: ['layout'],
filename: 'layout.html',
template: 'test/playground/layout/index.html',
}),
new HtmlWebpackPlugin({
chunks: ['viewmode'],
filename: 'viewmode.html',
template: 'test/playground/map-render/html/viewmode.html',
2021-10-05 02:38:11 +02:00
}),
2021-12-05 18:25:16 +01:00
new HtmlWebpackPlugin({
chunks: ['embedded'],
2021-12-05 18:25:16 +01:00
filename: 'embedded.html',
template: 'test/playground/map-render/html/embedded.html',
}),
new HtmlWebpackPlugin({
chunks: ['editor'],
filename: 'editor.html',
template: 'test/playground/map-render/html/editor.html',
}),
2021-10-05 02:38:11 +02:00
],
2021-09-07 22:31:46 +02:00
};
module.exports = merge(common, playgroundConfig);