-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
98 lines (93 loc) · 2.35 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
98
'use strict'
const path = require('path')
const deployLocation = 'examples'
module.exports = {
entry: {
loadingbar: './examples/src/loadingbar/index.jsx',
dialognative: './examples/src/dialognative/index.js',
},
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$/,
exclude: /node_modules/,
/* eslint-disable max-len */
loader: 'style-loader!css-loader?modules&importLoaders=1&localIdentName=[name]__[local]___[hash:base64:5]!postcss-loader'
/* eslint-enable max-len */
},
{
test: /\.css$/,
include: /node_modules/,
loader: 'style-loader!css-loader'
},
{
test: /\.scss$/,
loader: 'style-loader!css-loader!sass-loader'
}
]
},
postcss: [
require('autoprefixer'),
require('postcss-color-rebeccapurple'),
require('precss'),
require('postcss-reporter')
],
plugins: []
}
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'
]
}
}