forked from isomorphic-git/isomorphic-git
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.cjs
52 lines (50 loc) · 1.27 KB
/
webpack.config.cjs
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
const path = require('path')
const DuplicatePackageCheckerPlugin = require('duplicate-package-checker-webpack-plugin')
const { BundleAnalyzerPlugin } = require('webpack-bundle-analyzer')
module.exports = [
{
target: 'webworker',
entry: {
index: './src/index.js',
'internal-apis': './src/internal-apis.js',
},
output: {
path: path.resolve(__dirname),
filename: '[name].umd.min.js',
library: 'git',
libraryTarget: 'umd',
},
mode: 'production',
devtool: 'source-map',
plugins: [
new BundleAnalyzerPlugin({
openAnalyzer: false,
analyzerMode: 'static',
reportFilename: 'size_report.html',
defaultSizes: 'gzip',
excludeAssets: 'internal-apis\\.umd\\.min\\.js',
}),
new DuplicatePackageCheckerPlugin({
strict: true,
}),
],
module: {
rules: [
{
test: /\.js$/,
exclude: /node_modules/,
use: {
loader: 'babel-loader',
options: {
babelrc: false,
plugins: [
'@babel/plugin-proposal-object-rest-spread',
'@babel/plugin-transform-async-to-generator',
],
},
},
},
],
},
},
]