forked from isomorphic-git/isomorphic-git
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebpack.config.js
More file actions
58 lines (57 loc) · 1.44 KB
/
webpack.config.js
File metadata and controls
58 lines (57 loc) · 1.44 KB
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
const path = require('path')
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer')
.BundleAnalyzerPlugin
const DuplicatePackageCheckerPlugin = require('duplicate-package-checker-webpack-plugin')
module.exports = [
{
target: 'webworker',
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: true
})
],
resolve: {
alias: {
// 'bops' depends on 0.0.2 but 1.x (used by node-libs-browser) is compatible
'base64-js': require.resolve('base64-js')
}
},
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'
]
}
}
}
]
}
}
]