forked from isomorphic-git/isomorphic-git
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
52 lines (51 loc) · 1.26 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
41
42
43
44
45
46
47
48
49
50
51
52
const path = require('path')
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer')
.BundleAnalyzerPlugin
const DuplicatePackageCheckerPlugin = require('duplicate-package-checker-webpack-plugin')
module.exports = [
{
target: 'web',
entry: {
bundle: './src/index.js',
internal: './src/internal-apis.js'
},
output: {
path: path.resolve(__dirname, 'dist'),
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\\.umd\\.min\\.js'
}),
new DuplicatePackageCheckerPlugin({
strict: false
})
],
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'
]
}
}
}
]
}
}
]