-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebpack.config.local.babel.js
More file actions
48 lines (39 loc) · 1.17 KB
/
webpack.config.local.babel.js
File metadata and controls
48 lines (39 loc) · 1.17 KB
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
38
39
40
41
42
43
44
45
46
47
48
import path from 'path';
import webpack from 'webpack';
import BundleTracker from 'webpack-bundle-tracker';
import config from './webpack.config.base.babel';
config.devtool = 'inline-source-map';
// Apply Hot Module Reloading (HMR) in Dev
Object.assign(config.entry, {
hmr: [
// Include the client code. Note host/post.
'webpack-dev-server/client?http://localhost:3000',
// Hot reload only when compiled successfully
'webpack/hot/only-dev-server',
// Alternative with refresh on failure
// 'webpack/hot/dev-server',
],
});
config.output.publicPath = 'http://localhost:3000/assets/bundles/';
config.devServer = {
contentBase: path.join(__dirname, './assets/bundles/'),
inline: true,
host: '0.0.0.0',
port: 3000,
publicPath: config.output.publicPath,
hot: true,
quiet: false,
historyApiFallback: true,
};
config.module.rules.push(
{
test: /\.css$/,
use: ['style-loader', 'css-loader'],
});
config.plugins = config.plugins.concat([
new webpack.HotModuleReplacementPlugin(),
new webpack.NoEmitOnErrorsPlugin(),
new webpack.NamedModulesPlugin(),
new BundleTracker({ filename: './webpack-stats-dev.json' }),
]);
export default config;