KEMBAR78
ESM: restore support for ASAR · Issue #228064 · microsoft/vscode · GitHub
Skip to content

ESM: restore support for ASAR #228064

@bpasero

Description

@bpasero

For ESM we have disabled ASAR but we should investigate bringing it back.

We used to have this code to inject the lookup path:

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.

Metadata

Metadata

Assignees

Labels

ESMIssues caused by our AMD => ESM workdebtCode quality issueselectronIssues and items related to Electroninsiders-releasedPatch has been released in VS Code Insidersplan-itemVS Code - planned item for upcomingupstreamIssue identified as 'upstream' component related (exists outside of VS Code)

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions