-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebpack.config.js
More file actions
42 lines (35 loc) · 859 Bytes
/
webpack.config.js
File metadata and controls
42 lines (35 loc) · 859 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
36
37
38
39
40
41
42
const path = require('path');
module.exports = {
//input setup
entry: [
'./src/index.jsx',
],
// output setup
output: {
path: path.join(__dirname, 'public'),
filename: 'bundle.js'
},
// Check for file extensions
resolve: {
extensions: ['.js', '.jsx']
},
// setup modules to convert react and es2015
module: {
loaders: [{
exclude: /node_modules/,
loader: 'babel-loader',
query: {
presets: ['react', 'es2015', 'stage-0']
},
test: /\.jsx?$/
}]
},
// enable source mapping in devmode
devtool: 'source-map',
devServer: {
// without this below line react-router won't work
// see more at https://webpack.github.io/docs/webpack-dev-server.html#the-historyapifallback-option
historyApiFallback: true,
contentBase: path.join(__dirname, 'public')
}
}