-
Notifications
You must be signed in to change notification settings - Fork 18
Expand file tree
/
Copy pathwebpack.config.dev.js
More file actions
64 lines (62 loc) · 1.79 KB
/
webpack.config.dev.js
File metadata and controls
64 lines (62 loc) · 1.79 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
59
60
61
62
63
64
const path = require('path');
const {merge} = require('webpack-merge');
const commonConfig = require('./webpack.config.common');
const CopyPlugin = require("copy-webpack-plugin");
const {CleanWebpackPlugin} = require('clean-webpack-plugin');
const host = 'localhost';
const portHere = 9000;
const portThere = 7200;
module.exports = (env, argv) => merge(commonConfig(env, argv), {
mode: 'development',
devtool: 'source-map',
plugins: [
new CopyPlugin({
patterns: [
{
from: 'packages/root-config/node_modules/single-spa/lib/es2015/esm/single-spa.dev.js',
to: 'resources'
}
]
}),
new CleanWebpackPlugin()
],
devServer: {
// disableHostCheck: true,
allowedHosts: 'all',
// contentBase: path.join(__dirname, 'dist/'),
static: [
{
directory: path.join(__dirname, 'dist/')
},
{
directory: path.join(__dirname, 'wb-plugins'),
publicPath: '/plugins',
watch: true
}
],
compress: true,
hot: false,
liveReload: true,
port: portHere,
host: host,
headers: {
"Access-Control-Allow-Origin": "*",
"Access-Control-Allow-Methods": "GET, POST, PUT, DELETE, PATCH, OPTIONS",
"Access-Control-Allow-Headers": "X-Requested-With, content-type, Authorization, x-graphdb-repository",
},
// 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(', ');
}
}
}]
}
});