mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-19 08:08:39 +01:00
Disallow dynamic require/import in extensions
Follow up on https://github.com/microsoft/vscode/pull/296220 Let's make sure more code doesn't introduce this pattern without some thought
This commit is contained in:
@@ -104,6 +104,8 @@ function createServerHost(
|
||||
|
||||
const scriptPath = combinePaths(packageRoot, browser);
|
||||
try {
|
||||
// This file isn't bundled so we really do want a dynamic import here
|
||||
// eslint-disable-next-line no-restricted-syntax
|
||||
const { default: module } = await import(/* webpackIgnore: true */ scriptPath);
|
||||
return { module, error: undefined };
|
||||
} catch (e) {
|
||||
|
||||
Reference in New Issue
Block a user