-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
97 lines (88 loc) · 2.11 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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
'use strict'
// System Deps
var autoprefixer =require('autoprefixer');
var webpack =require('webpack');
var path =require('path');
// Only export the config to be consumed by webpack
// It builds an instance of a webpack compiler based on this
module.exports = {
// Entry points into the build process
entry: [
'webpack/hot/dev-server',
path.join(__dirname, '/index.js')
],
// Output build path
output: {
path: __dirname,
publicPath: '/',
filename: 'bundle.js'
},
// Set up source mapping for debugging
devtool: "inline-source-map",
// Webpack Loaders (transformations)
// http://webpack.github.io/docs/using-loaders.html
module: {
loaders: [
// Font files
{
test: /\.(ttf|eot|woff)(\?.*)?$/,
loaders: ['url']
},
// Clean up SVGs
{
test: /\.svg(\?.*)?$/,
loaders: ['url', 'svgo']
},
// Stylesheets
{
test: /\.css$/,
loaders: ['style', 'css']
},
// Compile Sass to CSS
{
test: /\.scss$/,
loaders: ["style", "css"]
},
// ES6
// {
// test: /\.(js|jsx)$/,
// exclude: /node_modules/,
// loaders: ['react-hot', 'babel?presets[]=es2015'],
// },
{
test: /\.js$/,
exclude: /node_modules/,
loader: 'babel?presets[]=es2015'
},
// Markup
{
test: /\.html$/,
loader: 'html'
},
// Standard JSON
{
test: /\.json$/,
loader: 'json'
},
// for bootstrap (see https://github.com/theodybrothers/webpack-bootstrap)
{
test: /\.eot(\?v=\d+\.\d+\.\d+)?$/, loader: "file"
}
]
},
// // ESLint specification
// eslint: {
// parser: 'babel-eslint'
// },
// Handle all vendor prefixes
postcss: () => {
return [autoprefixer];
},
// http://webpack.github.io/docs/using-plugins.html
plugins: [
// https://github.com/glenjamin/webpack-hot-middleware
new webpack.optimize.OccurenceOrderPlugin(),
new webpack.HotModuleReplacementPlugin(),
new webpack.NoErrorsPlugin()
]
};