-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
53 lines (52 loc) · 1.24 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
// webpack.config.js
var ExtractTextPlugin = require('extract-text-webpack-plugin');
var webpack = require('webpack');
var path = require('path');
module.exports = ({
entry: [
'webpack-dev-server/client?http://0.0.0.0:8080', // WebpackDevServer host and port
'webpack/hot/only-dev-server', // "only" prevents reload on syntax errors
'./app/index.js',
'./app/styles/styles.scss'
],
output: {
path: __dirname,
filename: 'bundle.js',
publicPath: '/dist/',
libraryTarget: 'umd',
},
resolve: {
alias: {
appConfig: path.resolve(__dirname) + '/env/dev-config.js',
},
extensions: ['', '.js']
},
module: {
loaders: [{
test: /\.js?$/,
exclude: /node_modules/,
loaders: ['react-hot', 'babel?presets[]=es2015,presets[]=react']
},
{
test: /\.scss/,
exclude: /node_modules/,
loader: ExtractTextPlugin.extract(
'style',
'css!sass'
)
},
{
test: /\.jpe?g$|\.gif$|\.png$|\.svg$|\.woff$|\.ttf$/,
loader: 'file'
}
],
},
plugins: [
new webpack.NoErrorsPlugin(),
new ExtractTextPlugin('style.css', {
allChunks: true
})
],
watch: true,
devtool: 'source-map',
});