diff --git a/src/js/builtins/BundlerPlugin.ts b/src/js/builtins/BundlerPlugin.ts index 93f3e921fe..be547859c8 100644 --- a/src/js/builtins/BundlerPlugin.ts +++ b/src/js/builtins/BundlerPlugin.ts @@ -38,35 +38,14 @@ interface BundlerPlugin { type Setup = BunPlugin["setup"]; type MinifyObj = Exclude; -// Local fallback typings. Replace with real bun-types once the package resolution is fixed. -// eslint-disable-next-line @typescript-eslint/consistent-type-definitions -type BunPlugin = { - name: string; - setup: (builder: any) => void | Promise; -}; - -type PluginBuilder = any; - -interface PluginConstraints { - filter: RegExp; - namespace?: string; -} - -type OnLoadCallback = (...args: any[]) => unknown; -type OnResolveCallback = (...args: any[]) => unknown; +// Node-style globals used inside built-in modules +declare function require(id: string): any; +declare const process: { platform: string } & any; type AnyFunction = (...args: any[]) => any; -interface BuildConfig { - target?: string; - root?: string; - plugins?: BunPlugin[]; - entryPoints?: string[]; - entrypoints?: string[]; - minify?: boolean | { identifiers?: boolean; syntax?: boolean; whitespace?: boolean }; -} - interface BuildConfigExt extends BuildConfig { + root?: string; /** esbuild-style alias */ entryPoints?: string[]; /** legacy lowercase alias */