-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
49 lines (48 loc) · 1014 Bytes
/
webpack.config.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
const webpack = require('webpack')
const {resolve} = require('path')
module.exports = {
entry: {
'html-ast-transform': resolve(__dirname, 'src', 'index.ts'),
'html-ast-transform.min': resolve(__dirname, 'src', 'index.ts')
},
output: {
path: resolve(__dirname, 'dist'),
filename: '[name].js',
library: 'HtmlAstTransform',
libraryTarget: 'umd',
umdNamedDefine: true,
globalObject: 'typeof self !== \'undefined\' ? self : this',
},
module: {
rules: [{
test: /\.ts$/,
include: resolve(__dirname, 'src'),
use: [
{
loader: 'babel-loader',
query: {
presets: [['@babel/preset-env']]
}
},
'ts-loader'
]
}]
},
resolve: {
extensions: ['.js', '.ts']
},
externals: {
parse5: {
commonjs: 'parse5',
commonjs2: 'parse5',
amd: 'parse5',
root: 'parse5'
}
},
devtool: 'source-map',
plugins: [
],
optimization: {
minimize: true,
}
}