-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.prod.js
51 lines (48 loc) · 1.45 KB
/
webpack.config.prod.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
const { composePlugins, withNx } = require('@nrwl/webpack');
const { withReact } = require('@nrwl/react');
const { withModuleFederation } = require('@nrwl/react/module-federation');
// todo: scan
const auth = require('./domains/auth/auth-shell/project.json');
const grid = require('./domains/grid/ag-grid-shell/project.json');
const home = require('./domains/home/home-shell/project.json');
const baseConfig = require('./module-federation.config');
const prodConfig = {
...baseConfig,
/*
* Remote overrides for production.
* Each entry is a pair of an unique name and the URL where it is deployed.
*
* e.g.
* remotes: [
* ['app1', 'http://app1.example.com'],
* ['app2', 'http://app2.example.com'],
* ]
*
* You can also use a full path to the remoteEntry.js file if desired.
*
* remotes: [
* ['app1', 'http://example.com/path/to/app1/remoteEntry.js'],
* ['app2', 'http://example.com/path/to/app2/remoteEntry.js'],
* ]
*/
remotes: [
[
auth.name,
`http://localhost:${auth.targets['serve-static'].options.port}/`,
],
[
grid.name,
`http://localhost:${grid.targets['serve-static'].options.port}/`,
],
[
home.name,
`http://localhost:${home.targets['serve-static'].options.port}/`,
],
],
};
// Nx plugins for webpack to build config object from Nx options and context.
module.exports = composePlugins(
withNx(),
withReact(),
withModuleFederation(prodConfig)
);