-
Notifications
You must be signed in to change notification settings - Fork 12
/
webpack.config.js
63 lines (56 loc) · 1.69 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
const webpack = require('webpack');
const path = require('path');
const APP = path.join(__dirname, 'app');
module.exports = {
// config goes here
context: APP,
entry: {
app: ['webpack/hot/dev-server', './core/bootstrap.js']
},
module: {
loaders: [
{ test: /\.js$/, loader: 'ng-annotate!babel?presets[]=es2015', exclude: /node_modules|bower_components/},
{ test: /\.js$/, loader: 'eslint-loader', exclude: /node_modules/},
{ test: /\.json$/, loader: 'file-loader?name=[name].[ext]', exclude: /node_modules/ },
{ test: /\.html$/, loader: 'ng-cache?prefix=[dir]/[dir]' },
// fonts
{
test: /\.woff(2)?(\?v=[0-9]\.[0-9]\.[0-9])?$/,
loader: 'url-loader?limit=10000&minetype=application/font-woff'
},
{ test: /\.(ttf|eot|svg)(\?v=[0-9]\.[0-9]\.[0-9])?$/, loader: 'file-loader' },
// styles
{ test: /\.css$/, loader: 'style!css' },
// images
{ test: /\.(jpg|png|gif)$/, loader: 'file'}
]
},
plugins: [
new webpack.ProvidePlugin({
d3: 'd3'
}),
new webpack.DefinePlugin({
__LOGGING__: true,
__PROXY__: true,
__PROXY_URL__: JSON.stringify(require('./development.conf.json').proxyUrl),
__SESSION_STORAGE__: true,
__SHOW_ENDPOINT__: true,
__VERSION__: JSON.stringify(require('./package.json').version)
})
],
devServer: {
proxy: {
'/sparql': {
target: 'http://localhost:8081',
rewrite: function (req) {
req.url = req.url.replace(/^\/sparql\/?(.+)$/, '$1');
}
}
}
},
output: {
path: APP,
filename: 'bundle.js'
},
devtool: 'source-map'
};