forked from CartoDB/carto-react
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.base.js
29 lines (28 loc) · 842 Bytes
/
webpack.base.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
const path = require('path');
const { ProgressPlugin } = require('webpack');
// const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin;
const mode = process.env.NODE_ENV || 'development';
// This is main configuration object.
// Here you write different options and tell Webpack what to do
module.exports = {
// Default mode for Webpack is production.
// Depending on mode Webpack will apply different things
// on final bundle.
mode,
devtool: mode === 'development' ? 'eval-source-map' : 'source-map',
entry: './src/index.js',
module: {
rules: [
{
test: /\.jsx?$/,
exclude: [/(node_modules)/, /(dist)/],
loader: 'babel-loader'
}
]
},
plugins: [
new ProgressPlugin()
// Uncomment for bundle analysis
// new BundleAnalyzerPlugin()
]
};