-
Notifications
You must be signed in to change notification settings - Fork 1
/
webpack.config.js
32 lines (28 loc) · 946 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
const path = require('path');// lets define to absolute path
module.exports = {
// the entry file for the bundle
entry: path.join(__dirname, '/client/src/App.js'),
// the bundle file we will get in the result
output: {
path: path.join(__dirname, '/client/dist/js'),
filename: 'app.js'
},
module: {
// apply loaders to files that meet given conditions
// were using babel-loader with presets for react and es2015
loaders: [
{
test: /\.js?$/,
include: path.join(__dirname, '/client/src'),
loader: 'babel-loader',
query: {
presets: ["react", "es2015"],
plugins: ["transform-es2015-destructuring", "transform-object-rest-spread"]
}
}
]
},
devtool: "source-map",//Lets get a better error handling - we can see all orrors in the termianl
// start Webpack in a watch mode, so Webpack will rebuild the bundle on changes
watch: true
};