web-eid / web-eid-webextension

The Web eID browser extension for Chrome, Edge, Firefox and other WebExtensions-compatible browsers
https://web-eid.eu
MIT License
15 stars 18 forks source link

Fixes rollup issues - Build failing with Node v20 and Microsoft PowerApps editor hanging #71

Closed taneltm closed 7 months ago

taneltm commented 7 months ago

Fix: Build failing with Node v20

Bundling with Rollup failed with exit code 1.
Piping stdout and stderr, ignoring stdin, while executing Rollup doesn't seem to behave as expected.
Changed from piping to stdio: 'inherit' to fix the issue. This is an old option and should be more stable in any Node version.

Fix: Microsoft PowerApps editor hangs on loading screen

Rollup plugin injectProcessEnv was used while compiling token-signing-page-script.js.
That script is injected to the page when TokenSigning backwards compatibility is turned on.
It then included code which made the PowerApps editor think it's code was running in Node.js (more specifically in Linux or Mac) instead of the browser, and then crashed.
After the change, injectProcessEnv plugin is only used while compiling the code which runs in the WebExtension context and doesn't interfere with the website's code.