Repository navigation
Labels
Milestone
Description
For ESM we have disabled ASAR but we should investigate bringing it back.
We used to have this code to inject the lookup path:
Lines 210 to 233 in 789c320
| module.exports.enableASARSupport = function () { | |
| // ESM-comment-begin | |
| // const NODE_MODULES_PATH = path.join(__dirname, '../node_modules'); | |
| // const NODE_MODULES_ASAR_PATH = `${NODE_MODULES_PATH}.asar`; | |
| // | |
| // // @ts-ignore | |
| // const originalResolveLookupPaths = Module._resolveLookupPaths; | |
| // | |
| // // @ts-ignore | |
| // Module._resolveLookupPaths = function (request, parent) { | |
| // const paths = originalResolveLookupPaths(request, parent); | |
| // if (Array.isArray(paths)) { | |
| // for (let i = 0, len = paths.length; i < len; i++) { | |
| // if (paths[i] === NODE_MODULES_PATH) { | |
| // paths.splice(i, 0, NODE_MODULES_ASAR_PATH); | |
| // break; | |
| // } | |
| // } | |
| // } | |
| // | |
| // return paths; | |
| // }; | |
| // ESM-comment-end | |
| }; |
But going forward, Electron should expose a way for us to enlist a path as ASAR path so that it can internally handle this as early as possible.
Activity
tmm1 commentedon Apr 8, 2025
Was there any movement on the Electron side here?
deepak1556 commentedon Apr 9, 2025
No we haven't pursued this yet in Electron.
4 remaining items