-
Notifications
You must be signed in to change notification settings - Fork 13
/
webpack.config.js
25 lines (23 loc) · 795 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
const webpack = require('webpack');
const path = require('path');
const BUILD_DIR = path.resolve(__dirname, 'client/public'); //path //dirname/src/public bundle.js directory
const APP_DIR = path.resolve(__dirname, 'client/src'); // index.jsx directory (react file)
module.exports = {
entry: `${APP_DIR}/index.jsx`, // FILE WE WILL BUNDLE FROM
output: {
path: BUILD_DIR, // WHERE BUNDLE.JS WILL GO
filename: 'bundle.js' // TRANSPILED FILE
},
module: {
loaders: [{
test: /\.jsx?/, // Specifying file type that will be transpiled
include: APP_DIR,
exclude: /node_modules/,
loader: 'babel-loader', // Tells which transpiler to use
query: {
presets: ['react', 'es2015'] // This could also be put in a .babelrc file
}
}
]
}
};