generated from RedHatInsights/frontend-starter-app
-
Notifications
You must be signed in to change notification settings - Fork 3
/
fec.config.js
61 lines (59 loc) · 1.82 KB
/
fec.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
const { resolve } = require('path');
const packageJson = require('./package.json');
const webpack = require('webpack');
const bundle = 'insights';
const appName = packageJson[bundle]['appname'];
module.exports = {
appName,
appUrl: `/${bundle}/inventory`, // currently the only frontend component lives on a host inventory system page
useProxy: process.env.PROXY === 'true',
debug: true,
plugins: [
new webpack.DefinePlugin({
IS_DEV: process.env.NODE_ENV === 'development',
}),
],
...(process.env.MOCK && {
customProxy: [
{
context: ["/api/inventory/v1/groups", "/api/inventory/v1/hosts"], // you can adjust the `context` value to redirect only specific endpoints
target: "http://127.0.0.1:4010", // default prism port
secure: false,
changeOrigin: true,
pathRewrite: { "^/api/inventory/v1": "" },
onProxyReq: (proxyReq) => {
proxyReq.setHeader("x-rh-identity", "foobar"); // avoid 401 errors by providing necessary security header
},
},
{
context: ["/api/runtimes-inventory-service/v1/instances"],
target: "http://127.0.0.1:3000",
secure: false,
changeOrigin: true,
pathRewrite: {
"^/api/runtimes-inventory-service/v1/instances": "instances",
},
},
],
}),
moduleFederation: {
shared: [
{
'react-router-dom': {
singleton: true,
import: false,
version: packageJson.dependencies['react-router-dom'],
requiredVersion: '>=6.0.0 <7.0.0',
},
},
],
exposes: {
'./RootApp': resolve(__dirname, '/src/AppEntry'),
// Host Inventory Runtimes Processes Card
'./RuntimesProcessesCard': resolve(
__dirname,
'/src/components/RuntimesProcessesCard.tsx'
),
},
},
};