forked from hcschuetz/15-puzzle
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebpack.config.js
More file actions
44 lines (38 loc) · 974 Bytes
/
Copy pathwebpack.config.js
File metadata and controls
44 lines (38 loc) · 974 Bytes
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
"use strict";
var path = require("path");
var webpack = require("webpack");
var args = require("minimist")(process.argv.slice(2));
var debug = !(args.production || args.p);
var config = {
target: "web",
entry: [
"!file?name=[path][name].[ext]&context=./src!./src/index.html",
"./src/index.js",
],
output: {
path: path.resolve("dist"),
filename: "bundle.js",
},
module: {
loaders: [
{ test: /\.js$/, exclude: /node_modules/, loader: "babel?stage=0" },
{ test: /\.json$/, loader: "json" },
{ test: /\.css$/, loader: "style!css" },
{ test: /\.less$/, loader: "style!css!less" },
{ test: /\.(eot|gif|svg|ttf|woff2?)(\?.*)?$/, loader: "url?limit=10000" },
{ test: /\.png$/, loader: "url-loader?mimetype=image/png" },
]
},
plugins: [
new webpack.DefinePlugin({
DEBUG: debug,
}),
],
progress: true,
};
if (debug) {
config.output.pathinfo = true;
config.debug = true;
config.devtool = "source-map";
}
module.exports = config;