forked from VandyHacks/vaken
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.dev.js
47 lines (46 loc) · 1.22 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 merge = require('webpack-merge');
const ErrorOverlayPlugin = require('error-overlay-webpack-plugin');
const FriendlyErrorsPlugin = require('friendly-errors-webpack-plugin');
const webpack = require('webpack');
const common = require('./webpack.common.js');
module.exports = merge.smart(common, {
mode: 'development',
devtool: 'source-map',
devServer: {
hot: true, // Enable hot module replacement
open: false, // Do not open browser on 'npm start'
quiet: true, // Pretty console output
port: 8081,
historyApiFallback: true,
proxy: {
'/api': {
target: 'http://localhost:8080',
},
'/graphql': {
target: 'http://localhost:8080',
},
},
},
module: {
rules: [
{
// Include ts, tsx, js, and jsx files.
test: /\.(ts|js)x?$/,
exclude: [/server/, /node_modules/],
use: [
{
loader: 'thread-loader',
options: {
poolTimeout: Infinity, // set this to Infinity in watch mode - see https://github.com/webpack-contrib/thread-loader
},
},
],
},
],
},
plugins: [
new webpack.HotModuleReplacementPlugin(), // Auto-refresh on changes
new ErrorOverlayPlugin(), // Error overlay in browser
new FriendlyErrorsPlugin(), // Pretty console output
],
});