-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathwebpack.config.js
40 lines (39 loc) · 1.22 KB
/
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
const path = require('path');
const webpack = require('webpack');
const TerserPlugin = require('terser-webpack-plugin');
module.exports = {
mode: 'none',
entry: {
'xz-decompress': './src/xz-decompress.js',
'xz-decompress.min': './src/xz-decompress.js',
},
devtool: false,
output: {
filename: '[name].js',
path: path.resolve(__dirname, 'dist/package'),
library: 'xz-decompress',
libraryTarget: 'umd',
globalObject: 'this'
},
externals: [
'stream/web'
],
module: {
rules: [{
test: /\.wasm/,
type: 'asset/inline'
}]
},
optimization: {
minimize: true,
minimizer: [new TerserPlugin({ include: /\.min\.js$/, extractComments: false })]
},
plugins: [
new webpack.BannerPlugin({
banner: ''
+ 'Based on xzwasm (c) Steve Sanderson. License: MIT - https://github.com/SteveSanderson/xzwasm\n'
+ 'Contains xz-embedded by Lasse Collin and Igor Pavlov. License: Public domain - https://tukaani.org/xz/embedded.html\n'
+ 'and walloc (c) 2020 Igalia, S.L. License: MIT - https://github.com/wingo/walloc'
})
]
}