forked from hoogi91/charts
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebpack.config.js
More file actions
95 lines (93 loc) · 2.8 KB
/
webpack.config.js
File metadata and controls
95 lines (93 loc) · 2.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
import TerserPlugin from "terser-webpack-plugin";
import path from "path";
import * as url from 'url';
const __dirname = url.fileURLToPath(new URL('.', import.meta.url));
export default (env, argv) => [
{
optimization: {
minimizer: [
new TerserPlugin({
parallel: true,
terserOptions: {
output: {
comments: false,
},
},
extractComments: false,
}),
],
},
entry: {
ColorPaletteInputElement: path.join(__dirname, "/Resources/Private/Assets/JavaScript/main.js"),
},
module: {
rules: [
{
test: /\.(js)$/,
exclude: /node_modules/,
use: [
"babel-loader",
],
},
{
test: /\.(css)$/,
use: ["css-loader"],
},
]
},
output: {
filename: "[name].js",
libraryTarget: "amd",
path: path.join(__dirname, "/Resources/Public/JavaScript"),
publicPath: argv.mode !== "production" ? "/" : "../dist/"
},
externals: {
"DocumentService": "TYPO3/CMS/Core/DocumentService",
"Modal": "TYPO3/CMS/Backend/Modal",
}
},
{
optimization: {
minimizer: [
new TerserPlugin({
parallel: true,
terserOptions: {
output: {
comments: false,
},
},
extractComments: false,
}),
],
},
entry: {
apexcharts: path.join(__dirname, "/Resources/Private/Assets/JavaScript/Libs/apexcharts.js"),
chartjs: path.join(__dirname, "/Resources/Private/Assets/JavaScript/Libs/chartjs.js"),
},
module: {
rules: [
{
test: /\.(js)$/,
exclude: /node_modules/,
use: [
"babel-loader",
],
},
{
test: /\.(css)$/,
use: ["css-loader"],
},
]
},
output: {
filename: "[name].js",
library: {
name: "Hoogi91.Charts",
type: "window",
export: "default",
},
path: path.join(__dirname, "/Resources/Public/JavaScript"),
publicPath: argv.mode !== "production" ? "/" : "../dist/"
}
}
];