Monty Taylor | 4a781a7 | 2017-07-25 07:28:04 -0400 | [diff] [blame] | 1 | const path = require('path'); |
| 2 | const webpack = require('webpack'); |
| 3 | const Merge = require('webpack-merge'); |
| 4 | const CommonConfig = require('./webpack.common.js'); |
| 5 | const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin; |
| 6 | |
| 7 | module.exports = Merge(CommonConfig, { |
| 8 | |
| 9 | module: { |
| 10 | rules: [ |
| 11 | { |
| 12 | enforce: 'pre', |
| 13 | test: /\.js$/, |
| 14 | use: [ |
| 15 | 'babel-loader', |
| 16 | 'eslint-loader' |
| 17 | ], |
| 18 | exclude: /node_modules/, |
| 19 | } |
| 20 | ] |
| 21 | }, |
| 22 | plugins: [ |
| 23 | new webpack.HotModuleReplacementPlugin(), |
| 24 | new BundleAnalyzerPlugin({ |
| 25 | analyzerMode: 'static', |
| 26 | reportFilename: '../../../reports/bundle.html', |
| 27 | generateStatsFile: true, |
| 28 | openAnalyzer: false, |
| 29 | statsFilename: '../../../reports/stats.json', |
| 30 | }), |
| 31 | ] |
| 32 | }) |