-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathwebpack.config.dev.js
59 lines (58 loc) · 1.58 KB
/
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
var webpack = require("webpack");
var path = require("path");
module.exports = {
devtool: "eval",
entry: [
"./src/webpack-public-path",
"webpack-hot-middleware/client?reload=true", //note that it reloads the page if hot module reloading fails.
"./src/index.js"
],
target: "web",
output: {
path: __dirname + "/dist", // Note: Physical files are only output by the production build task `npm run build`.
publicPath: "/",
filename: "bundle.js"
},
plugins: [
new webpack.DefinePlugin({
"process.env.NODE_ENV": JSON.stringify("development"), // Tells React to build in either dev or prod modes. https://facebook.github.io/react/downloads.html (See bottom)
__DEV__: true
}),
new webpack.ProvidePlugin({
$: "jquery",
jQuery: "jquery"
}),
new webpack.NoEmitOnErrorsPlugin(),
new webpack.HotModuleReplacementPlugin()
],
module: {
rules: [
{
test: /\.js$/,
exclude: /(node_modules|bower_components)/,
use: {
loader: "babel-loader",
options: {
presets: ["env"]
}
}
},
{
test: /(\.css|\.scss)$/,
use: [
{ loader: "style-loader" },
{ loader: "css-loader", options: { sourceMap: true } },
{ loader: "sass-loader", options: { sourceMap: true } }
]
},
{
test: /\.(woff|woff2|eot|ttf|otf|svg|)(\?v=[a-z0-9]\.[a-z0-9]\.[a-z0-9])?$/,
use: ["url-loader?limit=100000r"]
},
{
test: /\.(png|jpg|gif|ico)$/,
use: ["file-loader"]
}
]
}
};