-
Notifications
You must be signed in to change notification settings - Fork 42
/
Copy pathwebpack.config.dev.babel.js
45 lines (40 loc) · 1.3 KB
/
webpack.config.dev.babel.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
import path from 'path';
import merge from 'webpack-merge';
import BaseWebpackConfig from './webpack.config.base.babel';
export default merge(BaseWebpackConfig, {
// The point or points to enter the application.
entry: {
app: [
'./frontend/src/index',
],
},
// Affecting the output of the compilation
output: {
// path: the output directory as an absolute path (required)
path: path.resolve(__dirname, 'frontend/dist/dev'),
// filename: specifies the name of entry output file (required)
filename: '[name].[hash:10].js',
// chunkFilename: specifies the name of non-entry output files (e.g. dynamic import component)
chunkFilename: '[name].[hash:10].js',
},
devServer: {
// Port number for webpack dev server
port: process.env.PORT_WEBPACK_DEV_SERVER,
// Proxy for api call
proxy: {
'/api/v1': {
target: `http://localhost:${process.env.PORT}/`,
secure: false,
},
},
// Automatically open page
open: true,
// Serves index.html (contains 404 page in react-router) in place of any 404 responses
historyApiFallback: true,
// Shows a full-screen overlay when there are compiler errors
overlay: true,
},
// Source map mode
// https://webpack.js.org/configuration/devtool
devtool: 'eval-source-map',
});