-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.dev.js
41 lines (40 loc) · 991 Bytes
/
webpack.config.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
const path = require("path");
const webpack = require("webpack");
const HTMLWebpackPlugin = require("html-webpack-plugin");
module.exports = {
mode: process.env.NODE_ENV,
devtool: "eval-source-map",
entry: "./src/dev.js",
plugins: [
new HTMLWebpackPlugin({
template: "src/index.html"
}),
new webpack.HotModuleReplacementPlugin(),
new webpack.DefinePlugin({
TEST_SCRIPT: JSON.stringify(process.argv[2])
})
],
output: {
filename: `[name].bundle.js`
},
module: {
rules: [
{
test: /\.(m?jsx?)$/,
exclude: /(node_modules|bower_components|build|umd)/,
enforce: "pre",
use: require.resolve("eslint-loader")
},
{
test: /\.js$/,
exclude: /(node_modules|bower_components|build)/,
use: {
loader: "babel-loader",
options: {
configFile: "./babel.config.js"
}
}
}
]
}
};