-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathwebpack-config.js
38 lines (34 loc) · 1.07 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
var webpack = require('webpack');
var path = require('path');
var BUILD_DIR = path.resolve(__dirname, 'src/client/public'); // Directory path of the bundle file output
var APP_DIR = path.resolve(__dirname, 'src/client/app'); // Directory path of react application
var config = {
entry: APP_DIR + '/index.jsx',
output: {
path: BUILD_DIR,
filename: 'bundle.js'
},
/**
* This syntax can be confusing (fortunately it’s not something we’ll
* be editing often). Basically we’re telling webpack to look for any .js
* files (excluding ones in the node_modules folder) and apply babel transpilation
* using babel-loader with the babel-preset-env preset. You can read more about
* webpack configuration syntax here.
*/
module: {
loaders: [
// {
// test: /\.js$/,
// loader: 'babel-loader',
// include : APP_DIR,
// exclude: /node_modules/
// },
{
test: /\.jsx$/,
loader: 'babel-loader',
include : APP_DIR,
exclude: /node_modules/ }
]
}
}
module.exports = config;