2021-07-16 16:41:58 +02:00
|
|
|
const path = require('path');
|
|
|
|
const { CleanWebpackPlugin } = require('clean-webpack-plugin');
|
2021-09-23 19:33:02 +02:00
|
|
|
const HtmlWebpackPlugin = require('html-webpack-plugin');
|
|
|
|
|
|
|
|
const namesHTML = [
|
2021-12-02 01:41:56 +01:00
|
|
|
'arrow',
|
|
|
|
'curvedLine',
|
|
|
|
'events',
|
|
|
|
'font',
|
|
|
|
'group',
|
|
|
|
'line',
|
|
|
|
'polyLine',
|
|
|
|
'prototype',
|
|
|
|
'rect',
|
|
|
|
'shapes',
|
|
|
|
'text',
|
|
|
|
'workspace',
|
2021-09-23 19:33:02 +02:00
|
|
|
];
|
|
|
|
|
2021-12-02 01:41:56 +01:00
|
|
|
const multiHtmlPlugin = namesHTML.map(
|
|
|
|
(name) => new HtmlWebpackPlugin({
|
|
|
|
chunks: ['testing'],
|
|
|
|
filename: `${name}.html`,
|
|
|
|
template: `test/playground/${name}.html`,
|
|
|
|
}),
|
|
|
|
);
|
2021-07-16 16:41:58 +02:00
|
|
|
|
|
|
|
module.exports = {
|
2021-12-02 01:41:56 +01:00
|
|
|
entry: {
|
|
|
|
testing: './test/playground/context-loader.js',
|
|
|
|
jquery: '../../libraries/jquery-2.1.0',
|
|
|
|
},
|
|
|
|
output: {
|
|
|
|
path: path.resolve(__dirname, 'dist', 'tests'),
|
|
|
|
filename: '[name].js',
|
|
|
|
publicPath: '/',
|
|
|
|
},
|
|
|
|
devServer: {
|
|
|
|
historyApiFallback: true,
|
|
|
|
port: 8080,
|
|
|
|
open: false,
|
|
|
|
},
|
|
|
|
mode: 'development',
|
|
|
|
devtool: 'source-map',
|
|
|
|
module: {
|
|
|
|
rules: [
|
|
|
|
{
|
|
|
|
use: 'babel-loader',
|
|
|
|
test: /.js$/,
|
|
|
|
exclude: [
|
|
|
|
/node_modules/,
|
|
|
|
path.resolve(__dirname, '../../libraries/mootools-core-1.4.5'),
|
|
|
|
path.resolve(__dirname, '../../libraries/underscore-min'),
|
2021-07-16 16:41:58 +02:00
|
|
|
],
|
2021-12-02 01:41:56 +01:00
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
resolve: {
|
|
|
|
alias: {
|
|
|
|
'@libraries': path.resolve(__dirname, '../../libraries/'),
|
|
|
|
'@svg': path.resolve(__dirname, './src/components/peer/svg/'),
|
|
|
|
'@utils': path.resolve(__dirname, './src/components/peer/utils/'),
|
|
|
|
'@components': path.resolve(__dirname, './src/components/'),
|
2021-07-16 16:41:58 +02:00
|
|
|
},
|
2021-12-02 01:41:56 +01:00
|
|
|
extensions: ['.js', '.json'],
|
|
|
|
},
|
|
|
|
plugins: [
|
|
|
|
new CleanWebpackPlugin(),
|
|
|
|
new HtmlWebpackPlugin({ template: 'test/playground/index.html' }),
|
|
|
|
].concat(multiHtmlPlugin),
|
2021-07-16 16:41:58 +02:00
|
|
|
};
|