Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/esbuild_deno_loader/test_deps.ts>esbuildNative.transform

Deno module resolution for `esbuild`
Go to Latest
function esbuildNative.transform
import { esbuildNative } from "https://deno.land/x/esbuild_deno_loader@0.7.1/test_deps.ts";
const { transform } = esbuildNative;

This function transforms a single JavaScript file. It can be used to minify JavaScript, convert TypeScript/JSX to JavaScript, or convert newer JavaScript to older JavaScript. It returns a promise that is either resolved with a "TransformResult" object or rejected with a "TransformFailure" object.

  • Works in node: yes
  • Works in browser: yes

Documentation: https://esbuild.github.io/api/#transform

Type Parameters

SpecificOptions extends TransformOptions

Parameters

input: string | Uint8Array
optional
options: SpecificOptions

Parameters

input: string | Uint8Array
optional
options: TransformOptions