-
Notifications
You must be signed in to change notification settings - Fork 3
/
webpack.config.build.js
60 lines (58 loc) · 1.08 KB
/
webpack.config.build.js
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
const path = require('path');
module.exports = (env) => ({
mode: "production",
entry: {
app: "./src/index.ts"
},
output: {
library: "VEditor",
libraryTarget: "umd",
filename: env.browser ? "VEditor.browser.js" : "VEditor.js"
},
resolve: {
extensions: ['.ts', '.js'],
alias: {
'@': path.join(__dirname, './src/'),
},
},
externals: env.browser ? {} : {
dagre: "dagre",
glMatrix: 'gl-matrix',
canvg: "canvg",
uuid: "uuid",
},
optimization: {
minimize: false
},
module: {
rules: [
{
test: /\.js|ts$/,
exclude: /(node_modules)/,
use: {
loader: "ts-loader"
}
},
{
test: /\.less$/,
use: [
"style-loader",
{
loader: "css-loader"
},
{
loader: "less-loader"
}
]
},
{
test: /\.(png|jpe?g|gif|svg)(\?.*)?$/,
loader: "url-loader"
},
{
test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/,
loader: "url-loader"
}
]
},
});