forked from react-ga/react-ga
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
33 lines (32 loc) · 877 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
const path = require('path');
const pkg = require('./package.json');
const TerserPlugin = require('terser-webpack-plugin');
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)),
module: {
rules: [
{ test: /\.jsx?$/, loader: 'babel-loader', exclude: /node_modules/ }
]
},
optimization: {
minimizer: [
new TerserPlugin({
include: /\.min\.js$/
})
]
}
};