-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use a specific interface for our esbuild options
This will always have a plugins, so it's better to reflect that. This also makes it easier to use in `config/assets.mjs` files.
- Loading branch information
Showing
4 changed files
with
24 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,7 @@ | ||
import { BuildOptions } from "esbuild"; | ||
import { BuildOptions, Plugin } from "esbuild"; | ||
import { Args } from "./args.js"; | ||
export declare const buildOptions: (root: string, args: Args) => Partial<BuildOptions>; | ||
export declare const watchOptions: (root: string, args: Args) => Partial<BuildOptions>; | ||
export interface EsbuildOptions extends Partial<BuildOptions> { | ||
plugins: Plugin[]; | ||
} | ||
export declare const buildOptions: (root: string, args: Args) => EsbuildOptions; | ||
export declare const watchOptions: (root: string, args: Args) => EsbuildOptions; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,12 @@ | ||
#!/usr/bin/env node | ||
import { BuildOptions, BuildContext } from "esbuild"; | ||
import { BuildContext } from "esbuild"; | ||
import { Args } from "./args.js"; | ||
import { EsbuildOptions } from "./esbuild.js"; | ||
interface RunOptions { | ||
root?: string; | ||
argv?: string[]; | ||
esbuildOptionsFn?: EsbuildOptionsFn; | ||
} | ||
type EsbuildOptionsFn = (args: Args, esbuildOptions: Partial<BuildOptions>) => Partial<BuildOptions>; | ||
type EsbuildOptionsFn = (args: Args, esbuildOptions: EsbuildOptions) => EsbuildOptions; | ||
export declare const run: (options?: RunOptions) => Promise<BuildContext | void>; | ||
export {}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters