-
Notifications
You must be signed in to change notification settings - Fork 9
/
webpack.config.js
48 lines (47 loc) · 1.31 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
const {resolve} = require('path');
const webpack = require('webpack');
module.exports = {
entry: [
"react-hot-loader/patch",
"webpack-dev-server/client?http://localhost:9090",
"webpack/hot/only-dev-server",
'./src/index.js'
],
output: {
filename: 'bundle.js',
path: resolve(__dirname, 'public'),
publicPath: 'http://localhost:9090/'
},
devtool: 'source-map',
module: {
loaders: [
{
test: /\.js?$/,
exclude: /node_modules/,
loader: 'babel-loader'
},
{
test: /\.css$/,
loader: 'style-loader!css-loader'
},
{
test: /\.scss$/,
use: [{
loader: "style-loader" // creates style nodes from JS strings
}, {
loader: "css-loader" // translates CSS into CommonJS
}, {
loader: "sass-loader" // compiles Sass to CSS
}]
},
{
test: /\.(png|woff|woff2|otf|ttf|svg|eot)$/,
use: ['url-loader']
}
]
},
plugins: [
new webpack.HotModuleReplacementPlugin(),
new webpack.NamedModulesPlugin()
]
};