Skip to content

Commit

Permalink
fix(bundle): allow raw options for esbuild
Browse files Browse the repository at this point in the history
  • Loading branch information
lowlighter committed Oct 24, 2024
1 parent 206007c commit 7b93053
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion bundle/ts/bundle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ import { delay } from "@std/async/delay"
* console.log(await bundle(`console.log("Hello world")`))
* ```
*/
export async function bundle(input: URL | string, { minify = "terser", format = "esm", debug = false, banner = "", shadow = true, config, exports } = {} as options): Promise<string> {
export async function bundle(input: URL | string, { minify = "terser", format = "esm", debug = false, banner = "", shadow = true, config, exports, raw } = {} as options): Promise<string> {
const url = input instanceof URL ? input : new URL(`data:application/typescript;base64,${encodeBase64(input)}`)
let code = ""
try {
Expand All @@ -59,6 +59,7 @@ export async function bundle(input: URL | string, { minify = "terser", format =
sourcesContent: debug,
bundle: true,
logLevel: "silent",
...raw,
})
code = output
if (minify) {
Expand Down Expand Up @@ -97,4 +98,5 @@ export type options = {
config?: URL
banner?: string
shadow?: boolean
raw?: Record<PropertyKey, unknown>
}

0 comments on commit 7b93053

Please sign in to comment.