Skip to content

Commit af46353

Browse files
authored
Merge pull request #25 from ajaysinghj8/fix-ng0203-duplicate-core
fix(NG0203): eliminate duplicate @angular/core causing production crash
2 parents b9f1e88 + a22b4c8 commit af46353

4 files changed

Lines changed: 8861 additions & 4399 deletions

File tree

.github/workflows/deploy-gh-pages.yml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,12 @@ jobs:
2222
node-version: '20'
2323
cache: 'npm'
2424

25-
# Library devDeps must be installed so the example build can resolve
26-
# @angular/core from the root node_modules (path alias ../src/public-api.ts)
27-
- name: Install library dependencies
25+
# Single install thanks to npm workspaces — all packages (root + example)
26+
# are hoisted into one node_modules tree, guaranteeing a single copy of
27+
# @angular/core and eliminating the NG0203 duplicate-module error.
28+
- name: Install dependencies
2829
run: npm ci
2930

30-
- name: Install example dependencies
31-
run: npm ci
32-
working-directory: example
3331

3432
- name: Build example
3533
run: npx ng build --base-href /angular-draggable/ --configuration production

example/tsconfig.json

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,22 @@
1919
"lib": ["ES2022", "dom"],
2020
"baseUrl": "",
2121
"paths": {
22-
"angular-draggable": ["../src/public-api.ts"]
22+
"angular-draggable": ["../src/public-api.ts"],
23+
"@angular/animations": ["./node_modules/@angular/animations"],
24+
"@angular/animations/*": ["./node_modules/@angular/animations/*"],
25+
"@angular/common": ["./node_modules/@angular/common"],
26+
"@angular/common/*": ["./node_modules/@angular/common/*"],
27+
"@angular/compiler": ["./node_modules/@angular/compiler"],
28+
"@angular/compiler/*": ["./node_modules/@angular/compiler/*"],
29+
"@angular/core": ["./node_modules/@angular/core"],
30+
"@angular/core/*": ["./node_modules/@angular/core/*"],
31+
"@angular/platform-browser": ["./node_modules/@angular/platform-browser"],
32+
"@angular/platform-browser/*": ["./node_modules/@angular/platform-browser/*"],
33+
"@angular/platform-browser-dynamic": ["./node_modules/@angular/platform-browser-dynamic"],
34+
"@angular/platform-browser-dynamic/*": ["./node_modules/@angular/platform-browser-dynamic/*"],
35+
"rxjs": ["./node_modules/rxjs"],
36+
"rxjs/*": ["./node_modules/rxjs/*"],
37+
"tslib": ["./node_modules/tslib"]
2338
}
2439
},
2540
"angularCompilerOptions": {

0 commit comments

Comments
 (0)