Skip to content

Commit db516e0

Browse files
committed
proof of concept
0 parents  commit db516e0

File tree

89 files changed

+33789
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

89 files changed

+33789
-0
lines changed

.editorconfig

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Editor configuration, see https://editorconfig.org
2+
root = true
3+
4+
[*]
5+
charset = utf-8
6+
indent_style = space
7+
indent_size = 2
8+
insert_final_newline = true
9+
trim_trailing_whitespace = true
10+
11+
[*.ts]
12+
quote_type = single
13+
14+
[*.md]
15+
max_line_length = off
16+
trim_trailing_whitespace = false

.gitignore

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# See http://help.github.com/ignore-files/ for more about ignoring files.
2+
3+
# compiled output
4+
/dist
5+
/tmp
6+
/out-tsc
7+
8+
# dependencies
9+
/node_modules
10+
11+
# IDEs and editors
12+
/.idea
13+
.project
14+
.classpath
15+
.c9/
16+
*.launch
17+
.settings/
18+
*.sublime-workspace
19+
20+
# IDE - VSCode
21+
.vscode/*
22+
!.vscode/settings.json
23+
!.vscode/tasks.json
24+
!.vscode/launch.json
25+
!.vscode/extensions.json
26+
27+
# misc
28+
/.sass-cache
29+
/connect.lock
30+
/coverage
31+
/libpeerconnection.log
32+
npm-debug.log
33+
yarn-error.log
34+
testem.log
35+
/typings
36+
37+
# System Files
38+
.DS_Store
39+
Thumbs.db

README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# FederationDemo
2+
3+
Demonstrates webpack 5 Module Federation with Angular and the Angular Router.
4+
5+
## Start
6+
7+
- ``npm run build``
8+
- ``npm run serve:dist``
9+
- Navigate to shell at http://localhost:5000
10+
- Navigate to standalone microfrontend at http://localhost:3000
11+

angular.json

Lines changed: 220 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,220 @@
1+
{
2+
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
3+
"version": 1,
4+
"newProjectRoot": "projects",
5+
"projects": {
6+
"shell": {
7+
"projectType": "application",
8+
"schematics": {},
9+
"root": "projects/shell",
10+
"sourceRoot": "projects/shell/src",
11+
"prefix": "app",
12+
"architect": {
13+
"build": {
14+
"builder": "ngx-build-plus:browser",
15+
"options": {
16+
"outputPath": "dist/shell",
17+
"index": "projects/shell/src/index.html",
18+
"main": "projects/shell/src/main.ts",
19+
"polyfills": "projects/shell/src/polyfills.ts",
20+
"tsConfig": "projects/shell/tsconfig.app.json",
21+
"aot": true,
22+
"assets": [
23+
"projects/shell/src/favicon.ico",
24+
"projects/shell/src/assets"
25+
],
26+
"styles": [
27+
"projects/shell/src/styles.css"
28+
],
29+
"scripts": []
30+
},
31+
"configurations": {
32+
"production": {
33+
"fileReplacements": [
34+
{
35+
"replace": "projects/shell/src/environments/environment.ts",
36+
"with": "projects/shell/src/environments/environment.prod.ts"
37+
}
38+
],
39+
"optimization": true,
40+
"outputHashing": "all",
41+
"sourceMap": false,
42+
"extractCss": true,
43+
"namedChunks": false,
44+
"extractLicenses": true,
45+
"vendorChunk": false,
46+
"buildOptimizer": true
47+
}
48+
}
49+
},
50+
"serve": {
51+
"builder": "ngx-build-plus:dev-server",
52+
"options": {
53+
"browserTarget": "shell:build",
54+
"port": 5000
55+
},
56+
"configurations": {
57+
"production": {
58+
"browserTarget": "shell:build:production"
59+
}
60+
}
61+
},
62+
"extract-i18n": {
63+
"builder": "@angular-devkit/build-angular:extract-i18n",
64+
"options": {
65+
"browserTarget": "shell:build"
66+
}
67+
},
68+
"test": {
69+
"builder": "ngx-build-plus:karma",
70+
"options": {
71+
"main": "projects/shell/src/test.ts",
72+
"polyfills": "projects/shell/src/polyfills.ts",
73+
"tsConfig": "projects/shell/tsconfig.spec.json",
74+
"karmaConfig": "projects/shell/karma.conf.js",
75+
"assets": [
76+
"projects/shell/src/favicon.ico",
77+
"projects/shell/src/assets"
78+
],
79+
"styles": [
80+
"projects/shell/src/styles.css"
81+
],
82+
"scripts": []
83+
}
84+
},
85+
"lint": {
86+
"builder": "@angular-devkit/build-angular:tslint",
87+
"options": {
88+
"tsConfig": [
89+
"projects/shell/tsconfig.app.json",
90+
"projects/shell/tsconfig.spec.json",
91+
"projects/shell/e2e/tsconfig.json"
92+
],
93+
"exclude": [
94+
"**/node_modules/**"
95+
]
96+
}
97+
},
98+
"e2e": {
99+
"builder": "@angular-devkit/build-angular:protractor",
100+
"options": {
101+
"protractorConfig": "projects/shell/e2e/protractor.conf.js",
102+
"devServerTarget": "shell:serve"
103+
},
104+
"configurations": {
105+
"production": {
106+
"devServerTarget": "shell:serve:production"
107+
}
108+
}
109+
}
110+
}
111+
},
112+
"mfe1": {
113+
"projectType": "application",
114+
"schematics": {},
115+
"root": "projects/mfe1",
116+
"sourceRoot": "projects/mfe1/src",
117+
"prefix": "app",
118+
"architect": {
119+
"build": {
120+
"builder": "@angular-devkit/build-angular:browser",
121+
"options": {
122+
"outputPath": "dist/mfe1",
123+
"index": "projects/mfe1/src/index.html",
124+
"main": "projects/mfe1/src/main.ts",
125+
"polyfills": "projects/mfe1/src/polyfills.ts",
126+
"tsConfig": "projects/mfe1/tsconfig.app.json",
127+
"aot": true,
128+
"assets": [
129+
"projects/mfe1/src/favicon.ico",
130+
"projects/mfe1/src/assets"
131+
],
132+
"styles": [
133+
"projects/mfe1/src/styles.css"
134+
],
135+
"scripts": []
136+
},
137+
"configurations": {
138+
"production": {
139+
"fileReplacements": [
140+
{
141+
"replace": "projects/mfe1/src/environments/environment.ts",
142+
"with": "projects/mfe1/src/environments/environment.prod.ts"
143+
}
144+
],
145+
"optimization": true,
146+
"outputHashing": "all",
147+
"sourceMap": false,
148+
"extractCss": true,
149+
"namedChunks": false,
150+
"extractLicenses": true,
151+
"vendorChunk": false,
152+
"buildOptimizer": true
153+
}
154+
}
155+
},
156+
"serve": {
157+
"builder": "@angular-devkit/build-angular:dev-server",
158+
"options": {
159+
"browserTarget": "mfe1:build",
160+
"port": 3000
161+
},
162+
"configurations": {
163+
"production": {
164+
"browserTarget": "mfe1:build:production"
165+
}
166+
}
167+
},
168+
"extract-i18n": {
169+
"builder": "@angular-devkit/build-angular:extract-i18n",
170+
"options": {
171+
"browserTarget": "mfe1:build"
172+
}
173+
},
174+
"test": {
175+
"builder": "@angular-devkit/build-angular:karma",
176+
"options": {
177+
"main": "projects/mfe1/src/test.ts",
178+
"polyfills": "projects/mfe1/src/polyfills.ts",
179+
"tsConfig": "projects/mfe1/tsconfig.spec.json",
180+
"karmaConfig": "projects/mfe1/karma.conf.js",
181+
"assets": [
182+
"projects/mfe1/src/favicon.ico",
183+
"projects/mfe1/src/assets"
184+
],
185+
"styles": [
186+
"projects/mfe1/src/styles.css"
187+
],
188+
"scripts": []
189+
}
190+
},
191+
"lint": {
192+
"builder": "@angular-devkit/build-angular:tslint",
193+
"options": {
194+
"tsConfig": [
195+
"projects/mfe1/tsconfig.app.json",
196+
"projects/mfe1/tsconfig.spec.json",
197+
"projects/mfe1/e2e/tsconfig.json"
198+
],
199+
"exclude": [
200+
"**/node_modules/**"
201+
]
202+
}
203+
},
204+
"e2e": {
205+
"builder": "@angular-devkit/build-angular:protractor",
206+
"options": {
207+
"protractorConfig": "projects/mfe1/e2e/protractor.conf.js",
208+
"devServerTarget": "mfe1:serve"
209+
},
210+
"configurations": {
211+
"production": {
212+
"devServerTarget": "mfe1:serve:production"
213+
}
214+
}
215+
}
216+
}
217+
}
218+
},
219+
"defaultProject": "shell"
220+
}

index.html

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<html>
2+
<head>
3+
<title>Demo</title>
4+
</head>
5+
<body>
6+
<app-root></app-root>
7+
</body>
8+
9+
<script src="./dist/mfe1/remoteEntry.js"></script>
10+
11+
<script src="/dist/shell/591.5ee8c463649be051c2ba.js"></script>
12+
<script src="/dist/shell/544.178624f373de961c4443.js"></script>
13+
14+
<script src="/dist/shell/3.076e0c842eff3b5861f4.js"></script>
15+
16+
17+
<script src="/dist/shell/2.fd70976f18a36150d9bb.js"></script>
18+
19+
20+
21+
<script src="/dist/shell/0.shell.js"></script>
22+
<script src="/dist/shell/1.main.js"></script>
23+
</html>
4.34 KB
Binary file not shown.

libs/_angular-devkit_architect.tgz

19.7 KB
Binary file not shown.
105 KB
Binary file not shown.
2.71 KB
Binary file not shown.
20.6 KB
Binary file not shown.

0 commit comments

Comments
 (0)