forked from benmvp/react-workshop
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
42 lines (38 loc) · 1.13 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
var webpack = require('webpack'),
path = require('path');
module.exports = {
// Entry point for the bundle with dev-server hot-loading
entry: [
'webpack-dev-server/client?http://localhost:8080',
'webpack/hot/only-dev-server',
'./src/index'
],
// Bundle location
output: {
path: path.join(__dirname, 'src/dist'),
publicPath: '/dist/',
filename: 'bundle.js'
},
// Pass all *.js files through Babel transpiling & React hot reloading
// Pass all *.scss files through SASS transpiling & include via <style> tag
module: {
loaders: [
{
test: /\.js?$/,
loaders: ['react-hot', 'babel'],
include: path.join(__dirname, 'src')
},
{
test: /\.scss$/,
loaders: ['style', 'css', 'sass'],
include: path.join(__dirname, 'src')
}
]
},
// Shim fetch API with whatwg-fetch
plugins: [
new webpack.ProvidePlugin({
'fetch': 'imports?this=>global!exports?global.fetch!whatwg-fetch'
})
]
};