forked from ethanselzer/react-hover-observer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
37 lines (36 loc) · 1.15 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
var path = require('path');
var BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin;
module.exports = {
entry: './src/ReactHoverObserver.js',
output: {
path: path.resolve(__dirname, './dist/umd'),
filename: 'ReactHoverObserver.js',
library: 'ReactHoverObserver',
libraryTarget: 'umd'
},
externals: {
react: {
commonjs: 'react',
commonjs2: 'react',
amd: 'react',
umd: 'react',
root: 'React'
}
},
module: {
rules: [
{
test: /\.js$/,
exclude: /node_modules/,
loader: 'babel-loader'
}
]
},
plugins: [new BundleAnalyzerPlugin({
// Can be `server`, `static` or `disabled`.
// In `server` mode analyzer will start HTTP server to show bundle report.
// In `static` mode single HTML file with bundle report will be generated.
// In `disabled` mode you can use this plugin to just generate Webpack Stats JSON file by setting `generateStatsFile` to `true`.
analyzerMode: 'disabled'
})]
};