Skip to content

Commit cfbf57f

Browse files
authored
fix(demos): add process.env.NODE_ENV polyfill for framework demos (#30868)
1 parent 7688142 commit cfbf57f

File tree

5 files changed

+29
-0
lines changed

5 files changed

+29
-0
lines changed

apps/demos/configs/Angular/config.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,11 @@ window.config = {
9898
experimentalDecorators: true,
9999
},
100100
meta: {
101+
'*': {
102+
'globals': {
103+
'process': 'process',
104+
},
105+
},
101106
'typescript': {
102107
'exports': 'ts',
103108
},
@@ -156,6 +161,7 @@ window.config = {
156161
'externals:': '../../../../bundles/externals/',
157162
},
158163
map: {
164+
'process': '../../../../utils/shared/process.js',
159165
'ts': 'npm:plugin-typescript/lib/plugin.js',
160166
'typescript': 'npm:typescript/lib/typescript.js',
161167
'jszip': 'npm:jszip/dist/jszip.min.js',

apps/demos/configs/React/config.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@ window.config = {
88
jsx: 'react',
99
},
1010
meta: {
11+
'*': {
12+
'globals': {
13+
'process': 'process',
14+
},
15+
},
1116
'react': {
1217
'esModule': true,
1318
},
@@ -49,6 +54,7 @@ window.config = {
4954
},
5055
defaultExtension: 'js',
5156
map: {
57+
'process': '../../../../utils/shared/process.js',
5258
'ts': 'npm:plugin-typescript/lib/plugin.js',
5359
'typescript': 'npm:typescript/lib/typescript.js',
5460
'jszip': 'npm:jszip/dist/jszip.min.js',

apps/demos/configs/ReactJs/config.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@ window.config = {
88
jsx: 'react',
99
},
1010
meta: {
11+
'*': {
12+
globals: {
13+
process: 'process',
14+
},
15+
},
1116
'react': {
1217
'esModule': true,
1318
},
@@ -49,6 +54,7 @@ window.config = {
4954
},
5055
defaultExtension: 'js',
5156
map: {
57+
'process': '../../../../utils/shared/process.js',
5258
'ts': 'npm:plugin-typescript/lib/plugin.js',
5359
'typescript': 'npm:typescript/lib/typescript.js',
5460
'jszip': 'npm:jszip/dist/jszip.min.js',

apps/demos/configs/Vue/config.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@ window.exports = window.exports || {};
22
window.config = {
33
transpiler: 'plugin-babel',
44
meta: {
5+
'*': {
6+
'globals': {
7+
'process': 'process',
8+
},
9+
},
510
'*.vue': {
611
loader: 'vue-loader',
712
},
@@ -46,6 +51,7 @@ window.config = {
4651
'externals:': '../../../../bundles/externals/',
4752
},
4853
map: {
54+
'process': '../../../../utils/shared/process.js',
4955
'vue': 'npm:vue/dist/vue.esm-browser.js',
5056
'@vue/shared': 'npm:@vue/shared/dist/shared.cjs.prod.js',
5157
'vue-loader': 'npm:dx-systemjs-vue-browser/index.js',

apps/demos/utils/shared/process.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
module.exports = {
2+
env: {
3+
NODE_ENV: "production",
4+
},
5+
};

0 commit comments

Comments
 (0)