-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
76 lines (74 loc) · 2.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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
var path = require('path');
var webpack = require('webpack');
var FlowtypePlugin = require('flowtype-loader/plugin');
//var GlobalizePlugin = require('globalize-webpack-plugin');
module.exports = {
devtool: 'cheap-module-source-map',
entry: [
'react-hot-loader/patch',
'webpack-hot-middleware/client',
'./src/app/index'
],
output: {
path: path.join(__dirname, 'dist'),
filename: 'bundle.js',
publicPath: '/static/'
},
plugins: [
// new GlobalizePlugin({
// production: false,
// developmentLocale: "en",
// supportedLocales: [ "ar", "de", "en", "es", "pt", "ru", "zh" ],
// messages: "messages/[locale].json",
// output: "i18n/[locale].[hash].js"
// }),
new FlowtypePlugin(),
new webpack.optimize.OccurenceOrderPlugin(),
new webpack.HotModuleReplacementPlugin(),
new webpack.NoErrorsPlugin(),
new webpack.ProvidePlugin({
$: "jquery",
jquery: "jquery",
jQuery: "jquery",
"window.jQuery": "jquery",
"window.jquery": "jquery"
}),
],
eslint: {
configFile: '.eslintrc',
failOnWarning: false,
failOnError: false
},
module: {
preLoaders: [
{
test: /\.js$/,
exclude: /node_modules/,
loader: 'eslint'
}
, {
test: /\.js$/
, loader: "flowtype"
, exclude: /node_modules/
}
],
loaders: [
{
test: /\.jsx?$/,
loaders: ['babel'],
include: path.join(__dirname, 'src')
}
, {
test: /\.css$/, loader: "style!css"
}
, {test: /\.less$/, loader: "style-loader!css-loader!less-loader"}
, {test: /\.gif$/, loader: "url-loader?mimetype=image/png"}
, {
test: /\.woff(2)?(\?[a-z0-9#=&.]+)?$/, loader: 'url?limit=10000&mimetype=application/font-woff'
}
, {
test: /\.(ttf|eot|svg)(\?[a-z0-9#=&.]+)?$/, loader: 'file'
}
]
}
};