-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
47 lines (43 loc) · 1.26 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
let webpack = require('webpack');
let FaviconsWebpackPlugin = require('favicons-webpack-plugin');
let HtmlWebpackPlugin = require('html-webpack-plugin');
let path = require('path');
module.exports = {
entry: [
'webpack-dev-server/client?http://localhost:3000',
'webpack/hot/only-dev-server',
'react-hot-loader/patch',
'./src/entry.js'
],
output: {
path: __dirname + '/dist',
filename: 'bundle.js',
publicPath: '/'
},
devtool: 'source-map',
module: {
loaders: [
{ test: /\.json$/, loader: "json-loader" },
{ test: /\.css$/, loader: "style!css" },
{ test: /\.scss$/, loaders: ["style", "css", "sass"] },
{ test: /\.jpe?g$|\.gif$|\.png$|\.svg$|\.woff$|\.ttf$|\.wav$|\.mp3$/, loader: "file" },
{ test: /\.js?$/, exclude: /node_modules/, loader: 'babel' },
// {enforce: 'pre', test: /\.js$/, loader: 'eslint-loader', exclude: /node_modules/},
]
},
plugins: [
new webpack.HotModuleReplacementPlugin(),
new FaviconsWebpackPlugin('./src/icon.png'),
new HtmlWebpackPlugin({
title: 'Gridlock',
template: './src/index.html'
})
],
resolve: {
root: path.resolve(__dirname, 'src'),
modules: [
'node_modules',
path.resolve(__dirname, 'src')
],
}
};