forked from GamesDoneQuick/donation-tracker-ui
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathshared.webpack.js
More file actions
executable file
·58 lines (56 loc) · 1.73 KB
/
shared.webpack.js
File metadata and controls
executable file
·58 lines (56 loc) · 1.73 KB
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
var ExtractTextPlugin = require('extract-text-webpack-plugin');
var packageJSON = require('./package.json');
var path = require('path');
function keyMirror(obj) {
return Object.keys(obj).reduce(function(memo, key) {
memo[key] = key;
return memo;
}, {});
}
module.exports = function(opts) {
return {
module: {
loaders: [
{
test: /\.jsx?$/,
exclude: /(node_modules|bower_components)/,
loader: (opts.hmr ? 'react-hot-loader!' : '') + 'babel-loader',
},
{
test: /\.css$/,
loader: 'style!css-loader?root=' + __dirname + '/../tracker&sourceMap!postcss-loader',
},
{
test: /\.(png|jpg|svg)$/,
loader: 'url-loader'
},
{
test: /\.woff(2)?(\?v=[0-9]\.[0-9]\.[0-9])?$/,
loader: 'url-loader?limit=10000&mimetype=application/font-woff'
},
{
test: /\.(ttf|eot|svg)(\?v=[0-9]\.[0-9]\.[0-9])?$/,
loader: 'file-loader'
}
],
},
node: {
fs: 'empty'
},
resolve: {
alias: {
ui: path.resolve('js'),
},
},
poll: 1000,
externals: keyMirror(packageJSON.dependencies),
devServer: {
proxy: {
'*': {
target: 'http://localhost:8000/',
headers: {'X-Webpack': 1}
}
}
}
};
};