-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathwebpack.config.js
More file actions
35 lines (30 loc) · 891 Bytes
/
webpack.config.js
File metadata and controls
35 lines (30 loc) · 891 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
const path = require('path');
module.exports = {
// sets entry point
entry: path.join(__dirname, '/app/app.js'),
// designates file to output plain compiled JavaScript
output: {
// path: path.join(__dirname, '/client/dist/js'),
path: path.join(__dirname, '/public/'),
// filename: 'app.js',
filename: "bundle.js"
},
// desribes transformations
module: {
// works with files with an .js or .jsx extension
loaders: [{
test: /\.jsx?$/,
// processes files in src folder
include: path.join(__dirname, '/app/'),
loader: 'babel-loader',
query: {
// specifies transformations
presets: ["react", "es2015"]
}
}],
},
// starts Webpack in a watch mode, so Webpack will rebuild the bundle on changes
watch: true,
// lets us debug our react code in Chrome dev tools
devtool: "eval-source-map"
};