-
Notifications
You must be signed in to change notification settings - Fork 6
/
webpack.config.js
41 lines (38 loc) · 2.37 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
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-product-store-ui',
filename: 'remoteEntry.js',
exposes: { './OneCXProductStoreModule': 'src/main.ts' },
shared: share({
'@angular/core': { requiredVersion: 'auto', includeSecondaries: true },
'@angular/common': { requiredVersion: 'auto', includeSecondaries: { skip: ['@angular/common/http/testing'] } },
'@angular/common/http': { requiredVersion: 'auto', includeSecondaries: true },
'@angular/forms': { requiredVersion: 'auto', includeSecondaries: true },
'@angular/platform-browser': { requiredVersion: 'auto', includeSecondaries: true },
'@angular/router': { requiredVersion: 'auto', includeSecondaries: true },
'@ngx-translate/core': { requiredVersion: 'auto' },
primeng: { 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-integration-interface': { 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-product-store-ui', publicPath: 'auto' },
experiments: { ...config.experiments, topLevelAwait: true },
optimization: { runtimeChunk: false, splitChunks: false }
}