-
Notifications
You must be signed in to change notification settings - Fork 16
/
webpack.config.dev.js
64 lines (62 loc) · 1.89 KB
/
webpack.config.dev.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
const PACKAGE = require('./package.json');
const path = require('path');
const merge = require('webpack-merge');
const commonConfig = require('./webpack.config.common');
const {CleanWebpackPlugin} = require('clean-webpack-plugin');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const host = 'localhost';
const portHere = 9000;
const portThere = 7200;
module.exports = merge(commonConfig, {
mode: 'development',
devtool: 'source-map',
output: {
filename: '[name].bundle.js',
chunkFilename: '[name].bundle.js',
path: path.resolve(__dirname, 'dist')
},
module: {
rules: [
{
test: /\.css$/,
use: ['style-loader', 'css-loader']
},
{
test: /\.less$/,
use: ['style-loader', 'css-loader', 'less-loader']
}
]
},
plugins: [
new HtmlWebpackPlugin({
template: './src/template.html',
favicon: 'src/img/icon.png',
templateParameters: {
version: PACKAGE.version,
devMode: true
}
}),
new CleanWebpackPlugin()
],
devServer: {
disableHostCheck: true,
contentBase: path.join(__dirname, 'dist/'),
compress: true,
port: portHere,
host: host,
// needed to handle urls sent by open id providers that contain dots
historyApiFallback: {
disableDotRule: true
},
proxy: [{
context: ['/rest', '/repositories', '/protocol', '/rdf-bridge'],
target: 'http://' + host + ':' + portThere,
onProxyRes: (proxyRes) => {
var key = 'www-authenticate';
if (proxyRes.headers[key]) {
proxyRes.headers[key] = proxyRes.headers[key].split(', ');
}
}
}]
}
});