main.d.ts 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642
  1. export type Platform = 'browser' | 'node' | 'neutral'
  2. export type Format = 'iife' | 'cjs' | 'esm'
  3. export type Loader = 'base64' | 'binary' | 'copy' | 'css' | 'dataurl' | 'default' | 'empty' | 'file' | 'js' | 'json' | 'jsx' | 'text' | 'ts' | 'tsx'
  4. export type LogLevel = 'verbose' | 'debug' | 'info' | 'warning' | 'error' | 'silent'
  5. export type Charset = 'ascii' | 'utf8'
  6. export type Drop = 'console' | 'debugger'
  7. interface CommonOptions {
  8. /** Documentation: https://esbuild.github.io/api/#sourcemap */
  9. sourcemap?: boolean | 'linked' | 'inline' | 'external' | 'both'
  10. /** Documentation: https://esbuild.github.io/api/#legal-comments */
  11. legalComments?: 'none' | 'inline' | 'eof' | 'linked' | 'external'
  12. /** Documentation: https://esbuild.github.io/api/#source-root */
  13. sourceRoot?: string
  14. /** Documentation: https://esbuild.github.io/api/#sources-content */
  15. sourcesContent?: boolean
  16. /** Documentation: https://esbuild.github.io/api/#format */
  17. format?: Format
  18. /** Documentation: https://esbuild.github.io/api/#global-name */
  19. globalName?: string
  20. /** Documentation: https://esbuild.github.io/api/#target */
  21. target?: string | string[]
  22. /** Documentation: https://esbuild.github.io/api/#supported */
  23. supported?: Record<string, boolean>
  24. /** Documentation: https://esbuild.github.io/api/#platform */
  25. platform?: Platform
  26. /** Documentation: https://esbuild.github.io/api/#mangle-props */
  27. mangleProps?: RegExp
  28. /** Documentation: https://esbuild.github.io/api/#mangle-props */
  29. reserveProps?: RegExp
  30. /** Documentation: https://esbuild.github.io/api/#mangle-props */
  31. mangleQuoted?: boolean
  32. /** Documentation: https://esbuild.github.io/api/#mangle-props */
  33. mangleCache?: Record<string, string | false>
  34. /** Documentation: https://esbuild.github.io/api/#drop */
  35. drop?: Drop[]
  36. /** Documentation: https://esbuild.github.io/api/#minify */
  37. minify?: boolean
  38. /** Documentation: https://esbuild.github.io/api/#minify */
  39. minifyWhitespace?: boolean
  40. /** Documentation: https://esbuild.github.io/api/#minify */
  41. minifyIdentifiers?: boolean
  42. /** Documentation: https://esbuild.github.io/api/#minify */
  43. minifySyntax?: boolean
  44. /** Documentation: https://esbuild.github.io/api/#charset */
  45. charset?: Charset
  46. /** Documentation: https://esbuild.github.io/api/#tree-shaking */
  47. treeShaking?: boolean
  48. /** Documentation: https://esbuild.github.io/api/#ignore-annotations */
  49. ignoreAnnotations?: boolean
  50. /** Documentation: https://esbuild.github.io/api/#jsx */
  51. jsx?: 'transform' | 'preserve' | 'automatic'
  52. /** Documentation: https://esbuild.github.io/api/#jsx-factory */
  53. jsxFactory?: string
  54. /** Documentation: https://esbuild.github.io/api/#jsx-fragment */
  55. jsxFragment?: string
  56. /** Documentation: https://esbuild.github.io/api/#jsx-import-source */
  57. jsxImportSource?: string
  58. /** Documentation: https://esbuild.github.io/api/#jsx-development */
  59. jsxDev?: boolean
  60. /** Documentation: https://esbuild.github.io/api/#jsx-side-effects */
  61. jsxSideEffects?: boolean
  62. /** Documentation: https://esbuild.github.io/api/#define */
  63. define?: { [key: string]: string }
  64. /** Documentation: https://esbuild.github.io/api/#pure */
  65. pure?: string[]
  66. /** Documentation: https://esbuild.github.io/api/#keep-names */
  67. keepNames?: boolean
  68. /** Documentation: https://esbuild.github.io/api/#color */
  69. color?: boolean
  70. /** Documentation: https://esbuild.github.io/api/#log-level */
  71. logLevel?: LogLevel
  72. /** Documentation: https://esbuild.github.io/api/#log-limit */
  73. logLimit?: number
  74. /** Documentation: https://esbuild.github.io/api/#log-override */
  75. logOverride?: Record<string, LogLevel>
  76. }
  77. export interface BuildOptions extends CommonOptions {
  78. /** Documentation: https://esbuild.github.io/api/#bundle */
  79. bundle?: boolean
  80. /** Documentation: https://esbuild.github.io/api/#splitting */
  81. splitting?: boolean
  82. /** Documentation: https://esbuild.github.io/api/#preserve-symlinks */
  83. preserveSymlinks?: boolean
  84. /** Documentation: https://esbuild.github.io/api/#outfile */
  85. outfile?: string
  86. /** Documentation: https://esbuild.github.io/api/#metafile */
  87. metafile?: boolean
  88. /** Documentation: https://esbuild.github.io/api/#outdir */
  89. outdir?: string
  90. /** Documentation: https://esbuild.github.io/api/#outbase */
  91. outbase?: string
  92. /** Documentation: https://esbuild.github.io/api/#external */
  93. external?: string[]
  94. /** Documentation: https://esbuild.github.io/api/#packages */
  95. packages?: 'external'
  96. /** Documentation: https://esbuild.github.io/api/#alias */
  97. alias?: Record<string, string>
  98. /** Documentation: https://esbuild.github.io/api/#loader */
  99. loader?: { [ext: string]: Loader }
  100. /** Documentation: https://esbuild.github.io/api/#resolve-extensions */
  101. resolveExtensions?: string[]
  102. /** Documentation: https://esbuild.github.io/api/#main-fields */
  103. mainFields?: string[]
  104. /** Documentation: https://esbuild.github.io/api/#conditions */
  105. conditions?: string[]
  106. /** Documentation: https://esbuild.github.io/api/#write */
  107. write?: boolean
  108. /** Documentation: https://esbuild.github.io/api/#allow-overwrite */
  109. allowOverwrite?: boolean
  110. /** Documentation: https://esbuild.github.io/api/#tsconfig */
  111. tsconfig?: string
  112. /** Documentation: https://esbuild.github.io/api/#out-extension */
  113. outExtension?: { [ext: string]: string }
  114. /** Documentation: https://esbuild.github.io/api/#public-path */
  115. publicPath?: string
  116. /** Documentation: https://esbuild.github.io/api/#entry-names */
  117. entryNames?: string
  118. /** Documentation: https://esbuild.github.io/api/#chunk-names */
  119. chunkNames?: string
  120. /** Documentation: https://esbuild.github.io/api/#asset-names */
  121. assetNames?: string
  122. /** Documentation: https://esbuild.github.io/api/#inject */
  123. inject?: string[]
  124. /** Documentation: https://esbuild.github.io/api/#banner */
  125. banner?: { [type: string]: string }
  126. /** Documentation: https://esbuild.github.io/api/#footer */
  127. footer?: { [type: string]: string }
  128. /** Documentation: https://esbuild.github.io/api/#entry-points */
  129. entryPoints?: string[] | Record<string, string> | { in: string, out: string }[]
  130. /** Documentation: https://esbuild.github.io/api/#stdin */
  131. stdin?: StdinOptions
  132. /** Documentation: https://esbuild.github.io/plugins/ */
  133. plugins?: Plugin[]
  134. /** Documentation: https://esbuild.github.io/api/#working-directory */
  135. absWorkingDir?: string
  136. /** Documentation: https://esbuild.github.io/api/#node-paths */
  137. nodePaths?: string[]; // The "NODE_PATH" variable from Node.js
  138. }
  139. export interface StdinOptions {
  140. contents: string | Uint8Array
  141. resolveDir?: string
  142. sourcefile?: string
  143. loader?: Loader
  144. }
  145. export interface Message {
  146. id: string
  147. pluginName: string
  148. text: string
  149. location: Location | null
  150. notes: Note[]
  151. /**
  152. * Optional user-specified data that is passed through unmodified. You can
  153. * use this to stash the original error, for example.
  154. */
  155. detail: any
  156. }
  157. export interface Note {
  158. text: string
  159. location: Location | null
  160. }
  161. export interface Location {
  162. file: string
  163. namespace: string
  164. /** 1-based */
  165. line: number
  166. /** 0-based, in bytes */
  167. column: number
  168. /** in bytes */
  169. length: number
  170. lineText: string
  171. suggestion: string
  172. }
  173. export interface OutputFile {
  174. path: string
  175. /** "text" as bytes */
  176. contents: Uint8Array
  177. /** "contents" as text (changes automatically with "contents") */
  178. readonly text: string
  179. }
  180. export interface BuildResult<SpecificOptions extends BuildOptions = BuildOptions> {
  181. errors: Message[]
  182. warnings: Message[]
  183. /** Only when "write: false" */
  184. outputFiles: OutputFile[] | (SpecificOptions['write'] extends false ? never : undefined)
  185. /** Only when "metafile: true" */
  186. metafile: Metafile | (SpecificOptions['metafile'] extends true ? never : undefined)
  187. /** Only when "mangleCache" is present */
  188. mangleCache: Record<string, string | false> | (SpecificOptions['mangleCache'] extends Object ? never : undefined)
  189. }
  190. export interface BuildFailure extends Error {
  191. errors: Message[]
  192. warnings: Message[]
  193. }
  194. /** Documentation: https://esbuild.github.io/api/#serve-arguments */
  195. export interface ServeOptions {
  196. port?: number
  197. host?: string
  198. servedir?: string
  199. keyfile?: string
  200. certfile?: string
  201. onRequest?: (args: ServeOnRequestArgs) => void
  202. }
  203. export interface ServeOnRequestArgs {
  204. remoteAddress: string
  205. method: string
  206. path: string
  207. status: number
  208. /** The time to generate the response, not to send it */
  209. timeInMS: number
  210. }
  211. /** Documentation: https://esbuild.github.io/api/#serve-return-values */
  212. export interface ServeResult {
  213. port: number
  214. host: string
  215. }
  216. export interface TransformOptions extends CommonOptions {
  217. tsconfigRaw?: string | {
  218. compilerOptions?: {
  219. alwaysStrict?: boolean,
  220. importsNotUsedAsValues?: 'remove' | 'preserve' | 'error',
  221. jsx?: 'react' | 'react-jsx' | 'react-jsxdev' | 'preserve',
  222. jsxFactory?: string,
  223. jsxFragmentFactory?: string,
  224. jsxImportSource?: string,
  225. preserveValueImports?: boolean,
  226. target?: string,
  227. useDefineForClassFields?: boolean,
  228. },
  229. }
  230. sourcefile?: string
  231. loader?: Loader
  232. banner?: string
  233. footer?: string
  234. }
  235. export interface TransformResult<SpecificOptions extends TransformOptions = TransformOptions> {
  236. code: string
  237. map: string
  238. warnings: Message[]
  239. /** Only when "mangleCache" is present */
  240. mangleCache: Record<string, string | false> | (SpecificOptions['mangleCache'] extends Object ? never : undefined)
  241. /** Only when "legalComments" is "external" */
  242. legalComments: string | (SpecificOptions['legalComments'] extends 'external' ? never : undefined)
  243. }
  244. export interface TransformFailure extends Error {
  245. errors: Message[]
  246. warnings: Message[]
  247. }
  248. export interface Plugin {
  249. name: string
  250. setup: (build: PluginBuild) => (void | Promise<void>)
  251. }
  252. export interface PluginBuild {
  253. /** Documentation: https://esbuild.github.io/plugins/#build-options */
  254. initialOptions: BuildOptions
  255. /** Documentation: https://esbuild.github.io/plugins/#resolve */
  256. resolve(path: string, options?: ResolveOptions): Promise<ResolveResult>
  257. /** Documentation: https://esbuild.github.io/plugins/#on-start */
  258. onStart(callback: () =>
  259. (OnStartResult | null | void | Promise<OnStartResult | null | void>)): void
  260. /** Documentation: https://esbuild.github.io/plugins/#on-end */
  261. onEnd(callback: (result: BuildResult) =>
  262. (OnEndResult | null | void | Promise<OnEndResult | null | void>)): void
  263. /** Documentation: https://esbuild.github.io/plugins/#on-resolve */
  264. onResolve(options: OnResolveOptions, callback: (args: OnResolveArgs) =>
  265. (OnResolveResult | null | undefined | Promise<OnResolveResult | null | undefined>)): void
  266. /** Documentation: https://esbuild.github.io/plugins/#on-load */
  267. onLoad(options: OnLoadOptions, callback: (args: OnLoadArgs) =>
  268. (OnLoadResult | null | undefined | Promise<OnLoadResult | null | undefined>)): void
  269. /** Documentation: https://esbuild.github.io/plugins/#on-dispose */
  270. onDispose(callback: () => void): void
  271. // This is a full copy of the esbuild library in case you need it
  272. esbuild: {
  273. context: typeof context,
  274. build: typeof build,
  275. buildSync: typeof buildSync,
  276. transform: typeof transform,
  277. transformSync: typeof transformSync,
  278. formatMessages: typeof formatMessages,
  279. formatMessagesSync: typeof formatMessagesSync,
  280. analyzeMetafile: typeof analyzeMetafile,
  281. analyzeMetafileSync: typeof analyzeMetafileSync,
  282. initialize: typeof initialize,
  283. version: typeof version,
  284. }
  285. }
  286. /** Documentation: https://esbuild.github.io/plugins/#resolve-options */
  287. export interface ResolveOptions {
  288. pluginName?: string
  289. importer?: string
  290. namespace?: string
  291. resolveDir?: string
  292. kind?: ImportKind
  293. pluginData?: any
  294. }
  295. /** Documentation: https://esbuild.github.io/plugins/#resolve-results */
  296. export interface ResolveResult {
  297. errors: Message[]
  298. warnings: Message[]
  299. path: string
  300. external: boolean
  301. sideEffects: boolean
  302. namespace: string
  303. suffix: string
  304. pluginData: any
  305. }
  306. export interface OnStartResult {
  307. errors?: PartialMessage[]
  308. warnings?: PartialMessage[]
  309. }
  310. export interface OnEndResult {
  311. errors?: PartialMessage[]
  312. warnings?: PartialMessage[]
  313. }
  314. /** Documentation: https://esbuild.github.io/plugins/#on-resolve-options */
  315. export interface OnResolveOptions {
  316. filter: RegExp
  317. namespace?: string
  318. }
  319. /** Documentation: https://esbuild.github.io/plugins/#on-resolve-arguments */
  320. export interface OnResolveArgs {
  321. path: string
  322. importer: string
  323. namespace: string
  324. resolveDir: string
  325. kind: ImportKind
  326. pluginData: any
  327. }
  328. export type ImportKind =
  329. | 'entry-point'
  330. // JS
  331. | 'import-statement'
  332. | 'require-call'
  333. | 'dynamic-import'
  334. | 'require-resolve'
  335. // CSS
  336. | 'import-rule'
  337. | 'url-token'
  338. /** Documentation: https://esbuild.github.io/plugins/#on-resolve-results */
  339. export interface OnResolveResult {
  340. pluginName?: string
  341. errors?: PartialMessage[]
  342. warnings?: PartialMessage[]
  343. path?: string
  344. external?: boolean
  345. sideEffects?: boolean
  346. namespace?: string
  347. suffix?: string
  348. pluginData?: any
  349. watchFiles?: string[]
  350. watchDirs?: string[]
  351. }
  352. /** Documentation: https://esbuild.github.io/plugins/#on-load-options */
  353. export interface OnLoadOptions {
  354. filter: RegExp
  355. namespace?: string
  356. }
  357. /** Documentation: https://esbuild.github.io/plugins/#on-load-arguments */
  358. export interface OnLoadArgs {
  359. path: string
  360. namespace: string
  361. suffix: string
  362. pluginData: any
  363. }
  364. /** Documentation: https://esbuild.github.io/plugins/#on-load-results */
  365. export interface OnLoadResult {
  366. pluginName?: string
  367. errors?: PartialMessage[]
  368. warnings?: PartialMessage[]
  369. contents?: string | Uint8Array
  370. resolveDir?: string
  371. loader?: Loader
  372. pluginData?: any
  373. watchFiles?: string[]
  374. watchDirs?: string[]
  375. }
  376. export interface PartialMessage {
  377. id?: string
  378. pluginName?: string
  379. text?: string
  380. location?: Partial<Location> | null
  381. notes?: PartialNote[]
  382. detail?: any
  383. }
  384. export interface PartialNote {
  385. text?: string
  386. location?: Partial<Location> | null
  387. }
  388. /** Documentation: https://esbuild.github.io/api/#metafile */
  389. export interface Metafile {
  390. inputs: {
  391. [path: string]: {
  392. bytes: number
  393. imports: {
  394. path: string
  395. kind: ImportKind
  396. external?: boolean
  397. original?: string
  398. }[]
  399. format?: 'cjs' | 'esm'
  400. }
  401. }
  402. outputs: {
  403. [path: string]: {
  404. bytes: number
  405. inputs: {
  406. [path: string]: {
  407. bytesInOutput: number
  408. }
  409. }
  410. imports: {
  411. path: string
  412. kind: ImportKind | 'file-loader'
  413. external?: boolean
  414. }[]
  415. exports: string[]
  416. entryPoint?: string
  417. cssBundle?: string
  418. }
  419. }
  420. }
  421. export interface FormatMessagesOptions {
  422. kind: 'error' | 'warning'
  423. color?: boolean
  424. terminalWidth?: number
  425. }
  426. export interface AnalyzeMetafileOptions {
  427. color?: boolean
  428. verbose?: boolean
  429. }
  430. export interface WatchOptions {
  431. }
  432. export interface BuildContext<SpecificOptions extends BuildOptions = BuildOptions> {
  433. /** Documentation: https://esbuild.github.io/api/#rebuild */
  434. rebuild(): Promise<BuildResult<SpecificOptions>>
  435. /** Documentation: https://esbuild.github.io/api/#watch */
  436. watch(options?: WatchOptions): Promise<void>
  437. /** Documentation: https://esbuild.github.io/api/#serve */
  438. serve(options?: ServeOptions): Promise<ServeResult>
  439. cancel(): Promise<void>
  440. dispose(): Promise<void>
  441. }
  442. /**
  443. * This function invokes the "esbuild" command-line tool for you. It returns a
  444. * promise that either resolves with a "BuildResult" object or rejects with a
  445. * "BuildFailure" object.
  446. *
  447. * - Works in node: yes
  448. * - Works in browser: yes
  449. *
  450. * Documentation: https://esbuild.github.io/api/#build
  451. */
  452. export declare function build<SpecificOptions extends BuildOptions>(options: SpecificOptions): Promise<BuildResult<SpecificOptions>>
  453. export declare function build(options: BuildOptions): Promise<BuildResult>
  454. /**
  455. * This is the advanced long-running form of "build" that supports additional
  456. * features such as watch mode and a local development server.
  457. *
  458. * - Works in node: yes
  459. * - Works in browser: no
  460. *
  461. * Documentation: https://esbuild.github.io/api/#build
  462. */
  463. export declare function context<T extends BuildOptions>(options: T): Promise<BuildContext<T>>
  464. export declare function context(options: BuildOptions): Promise<BuildContext>
  465. /**
  466. * This function transforms a single JavaScript file. It can be used to minify
  467. * JavaScript, convert TypeScript/JSX to JavaScript, or convert newer JavaScript
  468. * to older JavaScript. It returns a promise that is either resolved with a
  469. * "TransformResult" object or rejected with a "TransformFailure" object.
  470. *
  471. * - Works in node: yes
  472. * - Works in browser: yes
  473. *
  474. * Documentation: https://esbuild.github.io/api/#transform
  475. */
  476. export declare function transform<SpecificOptions extends TransformOptions>(input: string | Uint8Array, options?: SpecificOptions): Promise<TransformResult<SpecificOptions>>
  477. export declare function transform(input: string | Uint8Array, options?: TransformOptions): Promise<TransformResult>
  478. /**
  479. * Converts log messages to formatted message strings suitable for printing in
  480. * the terminal. This allows you to reuse the built-in behavior of esbuild's
  481. * log message formatter. This is a batch-oriented API for efficiency.
  482. *
  483. * - Works in node: yes
  484. * - Works in browser: yes
  485. */
  486. export declare function formatMessages(messages: PartialMessage[], options: FormatMessagesOptions): Promise<string[]>
  487. /**
  488. * Pretty-prints an analysis of the metafile JSON to a string. This is just for
  489. * convenience to be able to match esbuild's pretty-printing exactly. If you want
  490. * to customize it, you can just inspect the data in the metafile yourself.
  491. *
  492. * - Works in node: yes
  493. * - Works in browser: yes
  494. *
  495. * Documentation: https://esbuild.github.io/api/#analyze
  496. */
  497. export declare function analyzeMetafile(metafile: Metafile | string, options?: AnalyzeMetafileOptions): Promise<string>
  498. /**
  499. * A synchronous version of "build".
  500. *
  501. * - Works in node: yes
  502. * - Works in browser: no
  503. *
  504. * Documentation: https://esbuild.github.io/api/#build
  505. */
  506. export declare function buildSync<SpecificOptions extends BuildOptions>(options: SpecificOptions): BuildResult<SpecificOptions>
  507. export declare function buildSync(options: BuildOptions): BuildResult
  508. /**
  509. * A synchronous version of "transform".
  510. *
  511. * - Works in node: yes
  512. * - Works in browser: no
  513. *
  514. * Documentation: https://esbuild.github.io/api/#transform
  515. */
  516. export declare function transformSync<SpecificOptions extends TransformOptions>(input: string, options?: SpecificOptions): TransformResult<SpecificOptions>
  517. export declare function transformSync(input: string | Uint8Array, options?: TransformOptions): TransformResult
  518. /**
  519. * A synchronous version of "formatMessages".
  520. *
  521. * - Works in node: yes
  522. * - Works in browser: no
  523. */
  524. export declare function formatMessagesSync(messages: PartialMessage[], options: FormatMessagesOptions): string[]
  525. /**
  526. * A synchronous version of "analyzeMetafile".
  527. *
  528. * - Works in node: yes
  529. * - Works in browser: no
  530. *
  531. * Documentation: https://esbuild.github.io/api/#analyze
  532. */
  533. export declare function analyzeMetafileSync(metafile: Metafile | string, options?: AnalyzeMetafileOptions): string
  534. /**
  535. * This configures the browser-based version of esbuild. It is necessary to
  536. * call this first and wait for the returned promise to be resolved before
  537. * making other API calls when using esbuild in the browser.
  538. *
  539. * - Works in node: yes
  540. * - Works in browser: yes ("options" is required)
  541. *
  542. * Documentation: https://esbuild.github.io/api/#browser
  543. */
  544. export declare function initialize(options: InitializeOptions): Promise<void>
  545. export interface InitializeOptions {
  546. /**
  547. * The URL of the "esbuild.wasm" file. This must be provided when running
  548. * esbuild in the browser.
  549. */
  550. wasmURL?: string | URL
  551. /**
  552. * The result of calling "new WebAssembly.Module(buffer)" where "buffer"
  553. * is a typed array or ArrayBuffer containing the binary code of the
  554. * "esbuild.wasm" file.
  555. *
  556. * You can use this as an alternative to "wasmURL" for environments where it's
  557. * not possible to download the WebAssembly module.
  558. */
  559. wasmModule?: WebAssembly.Module
  560. /**
  561. * By default esbuild runs the WebAssembly-based browser API in a web worker
  562. * to avoid blocking the UI thread. This can be disabled by setting "worker"
  563. * to false.
  564. */
  565. worker?: boolean
  566. }
  567. export let version: string