Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions esbuild.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,6 @@ await build({
plugins: [copyPlugin],
});

await build({
entryPoints: ["src/errors.ts"],
platform: "node",
target: "node22",
outfile: "dist/errors.js",
});

await build({
entryPoints: ["src/strip-loader.ts"],
bundle: false,
Expand Down
7 changes: 6 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1,6 @@
export { transformSync } from "./transform.ts";
export { transformSync } from "./internal/transform.ts";
export {
SwcError,
isSwcError,
wrapAndReThrowSwcError,
} from './internal/errors.ts';
2 changes: 1 addition & 1 deletion src/errors.ts → src/internal/errors.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
type SwcError = {
export type SwcError = {
code: "UnsupportedSyntax" | "InvalidSyntax";
message: string;
};
Expand Down
4 changes: 2 additions & 2 deletions src/transform.ts → src/internal/transform.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { Options, TransformOutput } from "../lib/wasm";
import swc from "../lib/wasm.js";
import type { Options, TransformOutput } from "../../lib/wasm";
import swc from "../../lib/wasm.js";

const DEFAULT_OPTIONS = {
mode: "strip-only",
Expand Down
3 changes: 1 addition & 2 deletions src/strip-loader.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import type { LoadFnOutput, LoadHookContext } from "node:module";
import { isSwcError, wrapAndReThrowSwcError } from "./errors.js";
import { transformSync } from "./index.js";
import { transformSync, isSwcError, wrapAndReThrowSwcError } from "./index.js";

export async function load(
url: string,
Expand Down
3 changes: 1 addition & 2 deletions src/transform-loader.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import type { LoadFnOutput, LoadHookContext } from "node:module";
import type { Options } from "../lib/wasm";
import { isSwcError, wrapAndReThrowSwcError } from "./errors.js";
import { transformSync } from "./index.js";
import { transformSync, isSwcError, wrapAndReThrowSwcError } from "./index.js";

export async function load(
url: string,
Expand Down
Loading