fix: transpile dynamic imports to cjs (#1975)

This commit is contained in:
Patrick Erichsen 2024-08-09 09:09:01 -07:00 • committed by GitHub
parent 28a2042b7f
commit 1e3e8ebe40
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 10 additions and 5 deletions

View file

@ -19,6 +19,7 @@ const esbuildConfig = {
// https://github.com/evanw/esbuild/issues/1492#issuecomment-893144483
inject: ["./scripts/importMetaUrl.js"],
define: { "import.meta.url": "importMetaUrl" },
supported: { "dynamic-import": false },
};
(async () => {

View file

@ -15,14 +15,18 @@ if (!fs.existsSync("build")) {
const isPreRelease = args.includes("--pre-release");
let command = isPreRelease
? "npx vsce package --out ./build patch --pre-release --no-dependencies" // --yarn"
: "npx vsce package --out ./build patch --no-dependencies"; // --yarn";
? "npx vsce package --out ./build patch --pre-release --no-dependencies" // --yarn"
: "npx vsce package --out ./build patch --no-dependencies"; // --yarn";
if (target) command += ` --target ${target}`;
if (target) {
command += ` --target ${target}`;
}
exec(command, (error) => {
if (error) throw error;
if (error) {
throw error;
}
console.log(
"vsce package completed - extension created at extensions/vscode/build/continue-patch.vsix",
"vsce package completed - extension created at extensions/vscode/build/continue-{version}.vsix",
);
});