-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.development.config.js
42 lines (34 loc) · 1.04 KB
/
webpack.development.config.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
const path = require("path");
const NodemonPlugin = require("nodemon-webpack-plugin");
const FlowBabelWebpackPlugin = require("flow-babel-webpack-plugin");
const config = {
mode: "development",
// Set the entry point of the app to src/index.js
entry: path.resolve(__dirname, "src", "index"),
// Set output file to dist/dev/server.js
output: {
path: path.resolve(__dirname, "dist", "dev"),
filename: "server.js"
},
// Load javascript files in ES6+ Format
module: {
rules: [
{
test: /\.js$/,
exclude: /(node_modules|bower_components)/,
use: {
loader: "babel-loader?cacheDirectory=true"
}
}
]
},
// Resolve modules relative to src in addition to node_modules
resolve: {
modules: [path.resolve(__dirname, "src"), "node_modules"]
},
// This allows us to use --watch and automatically run nodemon on the output server.js
plugins: [new NodemonPlugin(), new FlowBabelWebpackPlugin()],
// Set the dev tool
devtool: "source-map"
};
module.exports = config;