-
Notifications
You must be signed in to change notification settings - Fork 29
/
webpack.dev.js
47 lines (44 loc) · 1.08 KB
/
webpack.dev.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
38
39
40
41
42
43
44
45
46
47
const webpack = require('webpack');
const { mergeWithRules } = require('webpack-merge');
const path = require('path');
const ESLintPlugin = require('eslint-webpack-plugin');
const CommonConfig = require('./webpack.common');
const DevConfig = mergeWithRules({
devtool: 'replace',
module: {
rules: {
test: 'match',
use: 'prepend',
},
},
})(CommonConfig, {
mode: 'development',
devtool: 'inline-source-map',
devServer: {
hot: false,
historyApiFallback: { disableDotRule: true },
// host: '0.0.0.0', // Required for Docker -- someone will need to link this somehow
compress: true,
port: process.env.PORT || 3000,
static: {
directory: path.join(__dirname, 'dist'),
watch: true,
publicPath: '/',
},
},
module: {
rules: [
{
test: /\.(css|scss)$/,
use: [
{
// Creates `style` nodes from JS strings
loader: 'style-loader',
},
],
},
],
},
plugins: [new webpack.HotModuleReplacementPlugin(), new ESLintPlugin()],
});
module.exports = DevConfig;