Skip to content

Commit 6a22ed2

Browse files
authored
Merge pull request #28 from adrianjoshua-strutt/fix/global-not-defined-polyfills
fix: add polyfills to resolve 'global is not defined' error
2 parents aaa1aef + 52af090 commit 6a22ed2

File tree

3 files changed

+8
-1
lines changed

3 files changed

+8
-1
lines changed

angular.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
"index": "src/index.html",
1818
"browser": "src/main.ts",
1919
"polyfills": [
20+
"src/polyfills.ts",
2021
"zone.js"
2122
],
2223
"tsConfig": "tsconfig.app.json",
@@ -75,6 +76,7 @@
7576
"builder": "@angular-devkit/build-angular:karma",
7677
"options": {
7778
"polyfills": [
79+
"src/polyfills.ts",
7880
"zone.js",
7981
"zone.js/testing"
8082
],

src/polyfills.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
(window as any).global = window;
2+
(window as any).process = {
3+
env: { DEBUG: undefined },
4+
};

tsconfig.app.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
"types": []
77
},
88
"files": [
9-
"src/main.ts"
9+
"src/main.ts",
10+
"src/polyfills.ts"
1011
],
1112
"include": [
1213
"src/**/*.d.ts"

0 commit comments

Comments
 (0)