-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Closed
Description
Describe the bug
Continues #4718, in some cases the local require-function is still missing, meaning the global require-function is getting picked up.
Input code
import { getPathFromAmdModule } from 'vs/base/test/node/testUtils';
const fixturesFolder = getPathFromAmdModule(require, './fixtures');Config
{
"$schema": "http://json.schemastore.org/swcrc",
"exclude": "\\.js$",
"jsc": {
"parser": {
"syntax": "typescript",
"tsx": false,
"decorators": true
},
"target": "es2020",
"loose": false,
"minify": {
"compress": false,
"mangle": false
}
},
"module": {
"type": "amd"
},
"minify": false
}Playground link
No response
Expected behavior
The output should contain a dependeny onto "require" and define an function argument for it, e.g
define([
"require" // 👈 missing
"vs/base/test/node/testUtils"
], function(
require, // 👈 missing
_testUtils
) {
"use strict";
const fixturesFolder = (0, _testUtils).getPathFromAmdModule(require, './fixtures');
});Actual behavior
The output is missing the local-require function, e.g is
define([
"vs/base/test/node/testUtils"
], function(_testUtils) {
"use strict";
const fixturesFolder = (0, _testUtils).getPathFromAmdModule(require, './fixtures');
//☝️global-require which has no `.toUrl`-function
});Version
1.2.192
Additional context
related microsoft/vscode#150025