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 | |
| 6 | module.exports = Merge(CommonConfig, { |
| 7 | |
| 8 | // Enable Hot Module Replacement for devServer |
| 9 | devServer: { |
| 10 | hot: true, |
| 11 | contentBase: path.resolve(__dirname, './zuul/web/static'), |
| 12 | publicPath: '/' |
| 13 | }, |
| 14 | module: { |
| 15 | rules: [ |
| 16 | { |
| 17 | enforce: 'pre', |
| 18 | test: /\.js$/, |
| 19 | use: [ |
| 20 | 'babel-loader', |
| 21 | 'eslint-loader' |
| 22 | ], |
| 23 | exclude: /node_modules/, |
| 24 | } |
| 25 | ] |
| 26 | }, |
| 27 | plugins: [ |
| 28 | new webpack.HotModuleReplacementPlugin(), |
| 29 | // We only need to bundle the demo files when we're running locally |
| 30 | new webpack.ProvidePlugin({ |
| 31 | DemoStatusBasic: './status-basic.json', |
| 32 | DemoStatusOpenStack: './status-openstack.json', |
| 33 | DemoStatusTree: './status-tree.json' |
| 34 | }), |
| 35 | ] |
| 36 | }) |