-
Notifications
You must be signed in to change notification settings - Fork 13
/
webpack.config.development.js
94 lines (89 loc) · 2.24 KB
/
webpack.config.development.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
'use strict'
const path = require('path')
const HtmlWebpackPlugin = require('html-webpack-plugin')
const deployLocation = 'examples'
module.exports = {
entry: {
index: './examples/src/Loading.jsx'
},
color: true,
progress: true,
output: {
filename: 'build/[name].js',
path: path.join(__dirname, deployLocation),
publicPath: `/${deployLocation}`
},
colors: true,
resolve: {
extensions: ['', '.js', '.jsx']
},
module: {
loaders: [
{
test: /\.jsx?$/,
exclude: /(node_modules)/,
loaders: [
'babel?stage=0'
]
},
{
test: /\.(png|jpg|jpeg|gif)$/,
loader: 'file?name=/assets/[name].[ext]'
},
{
test: /\.woff(\?v=\d+\.\d+\.\d+)?$/,
loader: 'url?limit=10000&mimetype=application/font-woff&name=/assets/[name].[ext]'
},
{
test: /\.woff2(\?v=\d+\.\d+\.\d+)?$/,
loader: 'url?limit=10000&mimetype=application/font-woff&name=/assets/[name].[ext]'
},
{
test: /\.ttf(\?v=\d+\.\d+\.\d+)?$/,
loader: 'url?limit=10000&mimetype=application/octet-stream&name=/assets/[name].[ext]'
},
{
test: /\.eot(\?v=\d+\.\d+\.\d+)?$/,
loader: 'file?name=/assets/[name].[hash].[ext]'
},
{
test: /\.svg(\?v=\d+\.\d+\.\d+)?$/,
loader: 'url?limit=10000&mimetype=image/svg+xml&name=/assets/[name].[ext]'
},
{
test: /\.css$/,
/* eslint-disable max-len */
loader: 'style-loader!css-loader?modules&importLoaders=1&localIdentName=[name]__[local]___[hash:base64:5]!postcss-loader'
/* eslint-enable max-len */
}
]
},
postcss: [
require('autoprefixer'),
require('postcss-color-rebeccapurple'),
require('precss'),
require('postcss-reporter')
],
plugins: [
new HtmlWebpackPlugin({
template: './examples/src/index.html',
inject: 'body',
filename: 'build/index.html'
})
]
}
if (process.argv.indexOf('--enable-eslint') !== -1) {
module.exports.module.preLoaders = [
{
test: /\.(js|jsx)$/,
loader: 'eslint-loader',
exclude: /node_modules/
}
]
module.exports.eslint = {
configFile: '.eslintrc',
plugins: [
'react'
]
}
}