-
Notifications
You must be signed in to change notification settings - Fork 2
/
webpack.dev.js
38 lines (36 loc) · 905 Bytes
/
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
const path = require("path");
const webpack = require("webpack");
const APP_DIR = path.resolve(__dirname, "./src");
const BUILD_DIR = path.resolve(__dirname, "./dist");
module.exports = {
mode: "development",
entry: APP_DIR + "/index.js",
output: {
path: BUILD_DIR,
filename: "bundle.js",
publicPath: "/"
},
resolve: { extensions: ["*", ".js", ".jsx"] },
module: {
rules: [
{
test: /\.(js|jsx)$/,
exclude: /(node_modules|bower_components)/,
loader: "babel-loader",
options: { presets: ["env"] }
},
{
test: /\.css$/,
use: ["style-loader", "css-loader"]
}
]
},
devServer: {
contentBase: path.join(__dirname, "public/"),
port: 3000,
publicPath: "http://localhost:3000/dist/",
historyApiFallback: true,
hotOnly: true
},
plugins: [new webpack.HotModuleReplacementPlugin()]
};