Skip to content

Commit

Permalink
Fix web version 'process' pollyfill
Browse files Browse the repository at this point in the history
  • Loading branch information
tareqimbasher committed Jun 8, 2024
1 parent 407bdea commit ec1ee4e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/Apps/NetPad.Apps.App/App/src/core/@common/utils/system.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import * as process from "process";

export class System {
/**
* Opens a URL in system-configured default browser.
Expand All @@ -15,9 +13,13 @@ export class System {
}

public static getPlatform() {
try {
return process.platform;
} catch {
if (this.isRunningInElectron()) {
try {
return require("process").platform;
} catch {
return undefined;
}
} else {
return undefined;
}
}
Expand Down
1 change: 1 addition & 0 deletions src/Apps/NetPad.Apps.App/App/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ module.exports = function (env, {analyze}) {
],
fallback: {
"fs": false,
"process": false,
"path": require.resolve("path-browserify"),
},
alias: {
Expand Down

0 comments on commit ec1ee4e

Please sign in to comment.