forked from firefox-devtools/debugger
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
51 lines (47 loc) · 1.26 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
43
44
45
46
47
48
49
50
51
"use strict";
const path = require("path");
const ExtractTextPlugin = require("extract-text-webpack-plugin");
const isEnabled = require("./public/js/configs/feature").isEnabled;
let config = {
entry: "./public/js/main.js",
devtool: "source-map",
output: {
path: path.join(__dirname, "public/build"),
filename: "bundle.js"
},
resolve: {
alias: {
"devtools": path.join(__dirname, "./public/js/lib/devtools"),
"devtools-sham": path.join(__dirname, "./public/js/lib/devtools-sham"),
"sdk": path.join(__dirname, "./public/js/lib/devtools-sham/sdk")
}
},
module: {
loaders: [
{
test: /\.json$/,
loader: "json"
},
{
test: /\.css$/,
loader: ExtractTextPlugin.extract("style-loader", "css-loader")
}
]
},
plugins: [
new ExtractTextPlugin("styles.css")
]
};
// NOTE: This is only needed to fix a bug with chrome devtools' debugger and
// destructuring params https://github.com/jlongster/debugger.html/issues/67
if (isEnabled("transformParameters")) {
config.module.loaders.push({
test: /\.js$/,
exclude: /(node_modules|bower_components)/,
loader: "babel",
query: {
plugins: ["transform-es2015-parameters"]
}
});
}
module.exports = config;