-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
116 lines (113 loc) · 2.75 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
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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
const {
ModifyEntryPlugin,
} = require('@angular-architects/module-federation/src/utils/modify-entry-plugin');
const {
share,
withModuleFederationPlugin,
} = require('@angular-architects/module-federation/webpack');
const webpack = require('webpack');
const config = withModuleFederationPlugin({
name: 'onecx-chat-ui-app',
filename: 'remoteEntry.js',
exposes: {
'./OnecxChatUiModule': './src/bootstrap.ts',
'./OneCXChatPanelComponent': 'src/app/remotes/chat-panel/chat-panel.component.main.ts'
},
shared: share({
'@angular/core': {
requiredVersion: 'auto',
includeSecondaries: true,
},
'@angular/platform-browser': {
requiredVersion: 'auto',
includeSecondaries: true,
},
'@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,
},
rxjs: {
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-remote-components': {
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,
},
'@ngx-translate/core': {
requiredVersion: 'auto',
},
}),
sharedMappings: ['@onecx/portal-integration-angular'],
});
const plugins = config.plugins.filter(
(plugin) => !(plugin instanceof ModifyEntryPlugin)
);
module.exports = {
...config,
plugins: [
...plugins,
new webpack.DefinePlugin({
ngDevMode: 'undefined',
}),
],
output: {
uniqueName: 'onecx-chat-ui',
publicPath: 'auto',
},
experiments: {
...config.experiments,
topLevelAwait: true,
},
optimization: {
runtimeChunk: false,
splitChunks: false,
},
};