forked from react-ga/react-ga
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
34 lines (33 loc) · 939 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
const path = require('path');
const TerserPlugin = require('terser-webpack-plugin');
const pkg = require('./package.json');
module.exports = {
entry: {
'react-ga': './src/index.js',
'react-ga.min': './src/index.js',
'react-ga-core': './src/core.js',
'react-ga-core.min': './src/core.js'
},
output: {
path: path.resolve('./dist'),
filename: '[name].js',
libraryTarget: 'umd',
globalObject: "typeof self !== 'undefined' ? self : this" // temporary fix for https://github.com/webpack/webpack/issues/6525
},
externals: []
.concat(Object.keys(pkg.peerDependencies || {}))
.concat(Object.keys(pkg.dependencies || {}))
.concat(Object.keys(pkg.devDependencies || {})),
module: {
rules: [
{ test: /\.jsx?$/, loader: 'babel-loader', exclude: /node_modules/ }
]
},
optimization: {
minimizer: [
new TerserPlugin({
include: /\.min\.js$/
})
]
}
};