-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
54 lines (48 loc) · 1.44 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
52
53
54
// // var path = require('path');
// // var webpack = require('webpack');
// module.exports = {
// entry: [
// "/src/app.js"
// ],
// output:{
// filename: 'public/assets/js/bundle.js',
// },
// module: {
// loaders: [{
// test: /\.js$/,
// loader: 'babel',
// query:{
// presets: ['react', 'es2015']
// },
// include: path.join(__dirname, 'src')
// }]
// }
// };
module.exports = {
// This is the entry point or start of our react applicaton
entry: "./src/app.js",
// The plain compiled Javascript will be output into this file
output: {
filename: "public/bundle.js"
},
// This section desribes the transformations we will perform
module: {
loaders: [
{
// Only working with files that in in a .js or .jsx extension
test: /\.jsx?$/,
// Webpack will only process files in our app folder. This avoids processing
// node modules and server files unnecessarily
include: /app/,
loader: "babel",
query: {
// These are the specific transformations we'll be using.
presets: ["react", "es2015"]
}
}
]
},
// This lets us debug our react code in chrome dev tools. Errors will have lines and file names
// Without this the console says all errors are coming from just coming from bundle.js
devtool: "eval-source-map"
};