-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathwebpack.config.js
55 lines (49 loc) · 1.12 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
55
import path from 'path';
import webpack from 'webpack';
const host = '127.0.0.1';
const port = 7260;
export default {
devtool: 'inline-source-map',
context: path.resolve(__dirname, '.'),
entry: {
main: [
`webpack-dev-server/client?http://${host}:${port}`,
'webpack/hot/only-dev-server',
'./src/app.js'
]
},
output: {
path: path.resolve(__dirname, 'build'),
filename: 'app.bundle.js',
publicPath: 'http://127.0.0.1:7260/build'
},
module: {
loaders: [{
test: /\.jsx?/,
include: /src/,
loaders: [
'react-hot',
'babel?stage=0&loose=all'
]
}, {
test: /\.scss/,
loader: `style!css!autoprefixer?browsers=last 2 version!sass?outputStyle=expanded&sourceMap=true&sourceMapContents=true`
}]
},
progress: true,
resolve: {
modulesDirectories: [
'src',
'node_modules'
],
extension: ['', '.js', '.jsx', '.scss', '.css']
},
plugins: [
new webpack.HotModuleReplacementPlugin(),
new webpack.NoErrorsPlugin(),
new webpack.DefinePlugin({
__DEV__: true,
__DEVTOOLS__: true
})
]
};