-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
34 lines (34 loc) · 1.29 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
module.exports = {
devtool: "source-map", // Needed for debug to work
mode: "development", // Needed because compilation complains if it's missing
target: ["web", "es5"], // Stops Webpack bundling ES5 output from loader with ES6 arrows, duh
entry: "./app.js",
output: {
filename: "bundle.js",
devtoolModuleFilenameTemplate: "[resource-path]", // Removes the webpack:/// prefix, fixes debugging in VS2017
path: __dirname // Puts bundle in dist by default without this
},
resolve: {
extensions: [".js", ".jsx"]
},
module: {
rules: [
{
test: /\.(jsx|js)$/, // .js and .jsx files are bundled
exclude: /node_modules/, // ..but not in node_modules
use: [{
loader: "babel-loader",
options: {
presets: [
// Tell Babel what to target: 'defaults' includes ES5, so IE will (usually) work
["@babel/preset-env", {
"targets": "defaults"
}],
"@babel/preset-react" // Supports React
]
}
}]
}
]
}
}