-
Notifications
You must be signed in to change notification settings - Fork 1
/
webpack.config.js
42 lines (40 loc) · 1.11 KB
/
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
var webpack = require("webpack");
/* eslint-disable no-undef */
var environment = process.env["NODE_ENV"] || "development";
module.exports = {
entry: "./src/game",
output: {
path: __dirname + "/build/html",
filename: "index.js"
},
module: {
preLoaders: [
{ test: /\.(js|json)$/, exclude: /node_modules/, loader: "eslint-loader" }
],
loaders: [
{ test: /\.json$/, loader: "json" },
{
test: /src\/images\/.*\.(jpe?g|png|gif|svg)$/i,
loaders: [
"file?hash=sha512&digest=hex&name=images/[name].[ext]"
//"image-webpack?bypassOnDebug&optimizationLevel=7&interlaced=false"
]
},
{
test: /src\/sounds\/.*\.(mp3|ogg|wav)$/i,
loader: "file?hash=sha512&digest=hex&name=sounds/[name].[ext]"
},
{
test: /src\/index.html$/i,
loader: "file?hash=sha512&digest=hex&name=[name].[ext]"
}
]
},
plugins: [
new webpack.DefinePlugin({
__PRODUCTION__: environment === "production",
__TEST__: environment === "test",
__DEVELOPMENT__: environment === "development"
})
]
};