-
Notifications
You must be signed in to change notification settings - Fork 6
/
webpack.config.js
47 lines (44 loc) · 2.54 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
const { ModifyEntryPlugin } = require('@angular-architects/module-federation/src/utils/modify-entry-plugin')
const { share, withModuleFederationPlugin } = require('@angular-architects/module-federation/webpack')
const config = withModuleFederationPlugin({
name: 'onecx-iam-ui',
filename: 'remoteEntry.js',
exposes: {
'./OneCXIamModule': 'src/main.ts',
'./OneCXChangePasswordComponent': 'src/app/remotes/change-password/change-password.component.main.ts'
},
shared: share({
'@angular/core': { requiredVersion: 'auto' },
'@angular/forms': { requiredVersion: 'auto', includeSecondaries: true, eager: false },
'@angular/common': { requiredVersion: 'auto', includeSecondaries: { skip: ['@angular/common/http/testing'] } },
'@angular/common/http': { requiredVersion: 'auto', includeSecondaries: true },
'@angular/router': { requiredVersion: 'auto', includeSecondaries: true },
'@angular/platform-browser': { requiredVersion: 'auto', includeSecondaries: true },
'@ngx-translate/core': { requiredVersion: 'auto' },
rxjs: { requiredVersion: 'auto', includeSecondaries: true },
primeng: { requiredVersion: 'auto', includeSecondaries: true },
'@onecx/accelerator': { requiredVersion: 'auto', includeSecondaries: true },
'@onecx/angular-accelerator': { requiredVersion: 'auto', includeSecondaries: true },
'@onecx/angular-auth': { requiredVersion: 'auto', includeSecondaries: true },
'@onecx/angular-integration-interface': { requiredVersion: 'auto', includeSecondaries: true },
'@onecx/angular-remote-components': { requiredVersion: 'auto', includeSecondaries: true },
'@onecx/angular-testing': { requiredVersion: 'auto', includeSecondaries: true },
'@onecx/angular-webcomponents': { requiredVersion: 'auto', includeSecondaries: true },
'@onecx/integration-interface': { requiredVersion: 'auto', includeSecondaries: true },
'@onecx/keycloak-auth': { requiredVersion: 'auto', includeSecondaries: true },
'@onecx/portal-integration-angular': { requiredVersion: 'auto', includeSecondaries: true },
'@onecx/portal-layout-styles': { requiredVersion: 'auto', includeSecondaries: true }
}),
sharedMappings: ['@onecx/portal-integration-angular']
})
config.devServer = {
allowedHosts: 'all'
}
const plugins = config.plugins.filter((plugin) => !(plugin instanceof ModifyEntryPlugin))
module.exports = {
...config,
plugins,
output: { uniqueName: 'onecx-iam-ui', publicPath: 'auto' },
experiments: { ...config.experiments, topLevelAwait: true },
optimization: { runtimeChunk: false, splitChunks: false }
}