-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathwebpack.config.js
50 lines (40 loc) · 974 Bytes
/
webpack.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
43
44
45
46
47
48
49
50
var path = require("path")
var webpack = require("webpack")
var HtmlWebpackPlugin = require("html-webpack-plugin")
var TARGET = process.env.npm_lifecycle_event
var ROOT_PATH = path.resolve(__dirname)
var APP_PATH = path.resolve(ROOT_PATH, "app")
var BUILD_PATH = path.resolve(ROOT_PATH, "build")
module.exports = {
debug: true,
devtool: "eval-source-map",
entry: "./app/index",
output: {
path: BUILD_PATH,
filename: "bundle.js"
},
module: {
loaders: [
{
test: /\.js$/,
include: APP_PATH,
loaders: ["react-hot", "babel"]
},
{
test: /\.styl$/,
include: APP_PATH,
loaders: ["style-loader", "css-loader", "stylus-loader"]
},
{
test: /\.(png|jpg)$/,
include: APP_PATH,
loader: "url-loader?limit=25000"
}
// Fonts?
],
plugins: [
new webpack.HotModuleReplacementPlugin(),
new webpack.NoErrorsPlugin()
]
}
}