Skip to content

Commit

Permalink
chore: switch to esm and swc types
Browse files Browse the repository at this point in the history
  • Loading branch information
marco-ippolito committed Jul 27, 2024
1 parent b8e835f commit c63aa88
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
15 changes: 7 additions & 8 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
const swc = require("../lib/swc/wasm.js");
import swc from "../lib/swc/wasm.js";
import type { Options, TransformOutput } from "../lib/swc/wasm.d.ts";

const DEFAULT_OPTIONS = {
const DEFAULT_OPTIONS: Options = {
mode: "strip-only",
};

// biome-ignore lint/suspicious/noExplicitAny: Swc types are not available
function transformSync(source: string, options?: any): string {
export function transformSync(
source: string,
options: Options,
): TransformOutput {
return swc.transformSync(source, {
...DEFAULT_OPTIONS,
...options,
});
}

module.exports = {
transformSync,
};
4 changes: 2 additions & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
"allowSyntheticDefaultImports": true,
"baseUrl": ".",
"esModuleInterop": true,
"moduleResolution": "node",
"moduleResolution": "NodeNext",
"noEmit": true,
"forceConsistentCasingInFileNames": true,
"lib": ["ES2023"],
"module": "commonjs",
"module": "NodeNext",
"resolveJsonModule": true,
"skipLibCheck": true,
"verbatimModuleSyntax": true,
Expand Down

0 comments on commit c63aa88

Please sign in to comment.