-
Notifications
You must be signed in to change notification settings - Fork 32
/
webpack.config.js
39 lines (35 loc) · 949 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
26
27
28
29
30
31
32
33
34
35
36
37
38
var ExtractTextPlugin = require('extract-text-webpack-plugin');
function getEntrySources(sources) {
if (process.env.NODE_ENV !== 'production') {
sources.push('webpack-dev-server/client?http://localhost:8080');
sources.push('webpack/hot/only-dev-server');
}
return sources;
}
module.exports = {
entry: {
helloWorld: getEntrySources([
'./js/helloworld.js'
])
},
output: {
publicPath: 'http://localhost:8080/',
filename: 'public/[name].js'
},
module: {
loaders: [
{
test: /\.js$/, loaders: ['react-hot', 'jsx', 'babel'], exclude: /node_modules/
},
{
test: /\.scss$/,
loader: ExtractTextPlugin.extract('css!sass')
}
]
},
plugins: [
new ExtractTextPlugin('public/style.css', {
allChunks: true
})
]
};