Skip to content

Deno #30

Description

@DrSensor

Hi, is there an option to swap the SWC internal with wasm version instead of the default node addon?

Something like

import { rollup } from "npm:rollup"
import { swc } from "npm:rollup-plugin-swc3"

const build = await rollup({
  input: ["main.ts", "lib.mts"],
  plugins: [
    swc({
      wasm: "https://esm.sh/@swc/wasm-web/wasm_bg.wasm"
    }),
  ],
})
await build.write({ dir: "dist", format: "es" })
Just got an error with the default one since Deno doesn't support Node native addons
Error: Failed to convert napi value into rust type `Option<T>`
    at Compiler.<anonymous> (file:///home/wildan/.cache/deno/npm/registry.npmjs.org/@swc/core/1.3.24/index.js:216:33)
    at (file:///home/wildan/.cache/deno/npm/registry.npmjs.org/@swc/core/1.3.24/index.js:34:71)
    at __awaiter (file:///home/wildan/.cache/deno/npm/registry.npmjs.org/@swc/core/1.3.24/index.js:30:12)
    at Compiler.transform (file:///home/wildan/.cache/deno/npm/registry.npmjs.org/@swc/core/1.3.24/index.js:202:16)
    at transform (file:///home/wildan/.cache/deno/npm/registry.npmjs.org/@swc/core/1.3.24/index.js:344:21)
    at Object.transform (file:///home/wildan/.cache/deno/npm/registry.npmjs.org/rollup-plugin-swc3/0.8.0/dist/index.mjs:129:20)
    at (file:///home/wildan/.cache/deno/npm/registry.npmjs.org/rollup/3.9.1/dist/es/shared/rollup.js:23660:40)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions