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

Commit 8c4292e

Browse files
committed
fix: allow overriding the global.process object from both the app and the plugins
By default it will be undefined but the plugins and the app developers will be able to polyfill it. We had the same behavior with the Legacy Workflow.
1 parent 90846e1 commit 8c4292e

File tree

4 files changed

+6
-5
lines changed

4 files changed

+6
-5
lines changed

Diff for: templates/webpack.angular.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ module.exports = env => {
262262
// Define useful constants like TNS_WEBPACK
263263
new webpack.DefinePlugin({
264264
"global.TNS_WEBPACK": "true",
265-
"process": undefined,
265+
"process": "global.process",
266266
}),
267267
// Remove all files from the out dir.
268268
new CleanWebpackPlugin(itemsToClean, { verbose: !!verbose }),

Diff for: templates/webpack.javascript.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ module.exports = env => {
213213
// Define useful constants like TNS_WEBPACK
214214
new webpack.DefinePlugin({
215215
"global.TNS_WEBPACK": "true",
216-
"process": undefined,
216+
"process": "global.process",
217217
}),
218218
// Remove all files from the out dir.
219219
new CleanWebpackPlugin(itemsToClean, { verbose: !!verbose }),

Diff for: templates/webpack.typescript.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ module.exports = env => {
237237
// Define useful constants like TNS_WEBPACK
238238
new webpack.DefinePlugin({
239239
"global.TNS_WEBPACK": "true",
240-
"process": undefined,
240+
"process": "global.process",
241241
}),
242242
// Remove all files from the out dir.
243243
new CleanWebpackPlugin(itemsToClean, { verbose: !!verbose }),

Diff for: templates/webpack.vue.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ module.exports = env => {
7575
itemsToClean.push(`${join(projectRoot, "platforms", "android", "app", "src", "main", "assets", "snapshots")}`);
7676
itemsToClean.push(`${join(projectRoot, "platforms", "android", "app", "build", "configurations", "nativescript-android-snapshot")}`);
7777
}
78-
78+
7979
const config = {
8080
mode: mode,
8181
context: appFullPath,
@@ -238,7 +238,8 @@ module.exports = env => {
238238
// Define useful constants like TNS_WEBPACK
239239
new webpack.DefinePlugin({
240240
"global.TNS_WEBPACK": "true",
241-
"TNS_ENV": JSON.stringify(mode)
241+
"TNS_ENV": JSON.stringify(mode),
242+
"process": "global.process"
242243
}),
243244
// Remove all files from the out dir.
244245
new CleanWebpackPlugin(itemsToClean, { verbose: !!verbose }),

0 commit comments

Comments
 (0)