-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathdev.js
More file actions
55 lines (53 loc) · 1.05 KB
/
dev.js
File metadata and controls
55 lines (53 loc) · 1.05 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
49
50
51
52
53
54
55
const merge = require('webpack-merge');
const Dotenv = require('dotenv-webpack');
const base = require('./base');
const helpers = require('./helpers');
const hotReloadingEntries = ['react-hot-loader/patch'];
module.exports = merge.strategy({
entry: 'prepend',
})(base, {
mode: 'development',
devtool: 'inline-source-map',
resolve: {
alias: {
'react-dom': '@hot-loader/react-dom',
},
},
entry: {
app: hotReloadingEntries,
},
output: {
path: helpers.resolveFromRootPath('dist'),
filename: '[name].js',
},
devServer: {
inline: true,
host: 'localhost',
port: 8080,
stats: 'minimal',
hot: true,
proxy: {
'/graphql': 'http://localhost:8081',
},
},
plugins: [
new Dotenv({
path: 'dev.env',
}),
],
module: {
rules: [
{
test: /\.(png|jpg|gif|svg)$/,
loader: 'file-loader',
options: {
name: 'img/[name].[ext]',
},
},
{
test: /\.css$/,
use: ['style-loader', 'css-loader'],
},
],
},
});