Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: replace @babel/register with esbuild-wasm #5180

Merged
merged 12 commits into from
Feb 15, 2023
Prev Previous commit
Next Next commit
fix: support node nightly
merceyz committed Feb 15, 2023

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
commit ba493c37c873234cdfea324de0762cdca65fa4bc
8 changes: 6 additions & 2 deletions scripts/setup-ts-execution.js
Original file line number Diff line number Diff line change
@@ -42,8 +42,12 @@ if (process.versions.pnp)

const resolveVirtual = process.versions.pnp ? require(`pnpapi`).resolveVirtual : undefined;

// esbuild only supports major.minor.patch, no pre-release (nightly) specifier is allowed
// so we reduce the version down to major.minor
const NODE_VERSION = process.versions.node.split(`.`, 2).join(`.`);

const cache = {
version: `${esbuild.version}\0${process.versions.node}`,
version: `${esbuild.version}\0${NODE_VERSION}`,
files: new Map(),
isDirty: false,
};
@@ -91,7 +95,7 @@ pirates.addHook(
return cacheEntry.code;

const res = esbuild.transformSync(sourceCode, {
target: `node${process.versions.node}`,
target: `node${NODE_VERSION}`,
loader: path.extname(filename).slice(1),
sourcefile: filename,
sourcemap: `inline`,