-
Notifications
You must be signed in to change notification settings - Fork 43
/
Copy pathfec.config.js
76 lines (73 loc) · 2.2 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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
const { resolve } = require('path');
const alias = require('./config/aliases');
const packageJson = require('./package.json');
const { localRoutesFor } = require('./config/helpers');
const { sentryWebpackPlugin } = require('@sentry/webpack-plugin');
const bundle = 'insights';
const appName = packageJson[bundle].appname;
// TODO Move to fec webpack config similar to LOCAL_APPS
const routes = {
...(process.env.LOCAL_APIS && process.env.LOCAL_APIS !== ''
? localRoutesFor('/api', process.env.LOCAL_APIS)
: {}),
};
module.exports = {
appName,
appUrl: `/${bundle}/${appName}`,
useProxy: process.env.PROXY === 'true',
devtool: 'hidden-source-map',
plugins: [
// Put the Sentry Webpack plugin after all other plugins
...(process.env.SENTRY_AUTH_TOKEN
? [
sentryWebpackPlugin({
authToken: process.env.SENTRY_AUTH_TOKEN,
org: 'red-hat-it',
project: 'compliance-rhel',
moduleMetadata: ({ release }) => ({
dsn: `https://[email protected]/4508083145408512`,
org: 'red-hat-it',
project: 'compliance-rhel',
release,
}),
}),
]
: [
//Just injects debugIDs
sentryWebpackPlugin({
org: 'red-hat-it',
project: 'compliance-rhel',
moduleMetadata: ({ release }) => ({
dsn: `https://[email protected]/4508083145408512`,
org: 'red-hat-it',
project: 'compliance-rhel',
release,
}),
}),
]),
],
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/${process.env.NODE_ENV !== 'production' ? 'Dev' : ''}AppEntry`
),
'./SystemDetail': resolve(__dirname, '/src/Modules/ComplianceDetails'),
},
},
resolve: {
alias,
},
routes,
_unstableSpdy: true,
};