]> git.argeo.org Git - gpl/argeo-suite.git/blob - js/webpack.common.js
Fix concurrent modification exception when cleaning up UIs
[gpl/argeo-suite.git] / js / webpack.common.js
1 const MiniCssExtractPlugin = require('mini-css-extract-plugin');
2 //const CssMinimizerPlugin = require('css-minimizer-webpack-plugin');
3 const HtmlWebpackPlugin = require('html-webpack-plugin');
4 const path = require('path');
5
6 module.exports = {
7 entry: {
8 "geo": './src/geo/index.js',
9 "chart": './src/chart/index.js',
10 },
11 output: {
12 filename: '[name].[contenthash].js',
13 path: path.resolve(__dirname, 'org.argeo.app.js/org/argeo/app/js'),
14 publicPath: '/pkg/org.argeo.app.js',
15 clean: true,
16 },
17 optimization: {
18 moduleIds: 'deterministic',
19 runtimeChunk: 'single',
20 // split code
21 splitChunks: {
22 chunks: 'all',
23 },
24 // minimizer: [
25 // // For webpack@5 you can use the `...` syntax to extend existing minimizers (i.e. `terser-webpack-plugin`), uncomment the next line
26 // `...`,
27 // new CssMinimizerPlugin(),
28 // ],
29 },
30 module: {
31 rules: [
32 {
33 test: /\.(css)$/,
34 use: [
35 MiniCssExtractPlugin.loader,
36 'css-loader',
37 ],
38 },
39 ],
40 },
41 plugins: [
42 // deal with CSS
43 new MiniCssExtractPlugin(),
44 // deal with HTML generation
45 new HtmlWebpackPlugin({
46 title: 'Argeo Suite Geo JS',
47 template: 'src/geo/index.html',
48 scriptLoading: 'module',
49 filename: 'geo.html',
50 chunks: ['geo'],
51 }),
52 new HtmlWebpackPlugin({
53 title: 'Argeo Suite Chart JS',
54 template: 'src/chart/index.html',
55 scriptLoading: 'module',
56 filename: 'chart.html',
57 chunks: ['chart'],
58 }),
59
60 ],
61 };