Skip to content
This repository was archived by the owner on Aug 7, 2021. It is now read-only.

Commit 845f426

Browse files
authored
fix: define process as undefined (#619)
This will prevent webpack from adding a polyfill for `process` ([`process/browser.js`](https://github.com/defunctzombie/node-process/blob/master/browser.js)) whenever it sees this code: `typeof process`. What will change: - process will be undefined instead of Object. - `typeof process === 'undefined'` will return true - Angular Animations won't assume the app is running in node context ([check](https://github.com/angular/angular/blob/d4ac9698ba7dd829600ca4c8129fcbeae9cb4bed/packages/animations/browser/src/render/shared.ts#L17)) and won't trigger logic which breaks {N} animations. **Important** This may break plugins that check if the `process` object is defined. fixes NativeScript/nativescript-angular#1433
1 parent cb62986 commit 845f426

File tree

3 files changed

+3
-0
lines changed

3 files changed

+3
-0
lines changed

Diff for: templates/webpack.angular.js

+1
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,7 @@ module.exports = env => {
195195
// Define useful constants like TNS_WEBPACK
196196
new webpack.DefinePlugin({
197197
"global.TNS_WEBPACK": "true",
198+
"process": undefined,
198199
}),
199200
// Remove all files from the out dir.
200201
new CleanWebpackPlugin([ `${dist}/**/*` ]),

Diff for: templates/webpack.javascript.js

+1
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,7 @@ module.exports = env => {
170170
// Define useful constants like TNS_WEBPACK
171171
new webpack.DefinePlugin({
172172
"global.TNS_WEBPACK": "true",
173+
"process": undefined,
173174
}),
174175
// Remove all files from the out dir.
175176
new CleanWebpackPlugin([ `${dist}/**/*` ]),

Diff for: templates/webpack.typescript.js

+1
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,7 @@ module.exports = env => {
180180
// Define useful constants like TNS_WEBPACK
181181
new webpack.DefinePlugin({
182182
"global.TNS_WEBPACK": "true",
183+
"process": undefined,
183184
}),
184185
// Remove all files from the out dir.
185186
new CleanWebpackPlugin([ `${dist}/**/*` ]),

0 commit comments

Comments
 (0)