Skip to content

Commit

Permalink
fix(types): add WebExtConfig type, omit reload option, deprecate …
Browse files Browse the repository at this point in the history
…`firefox` option (#231)
  • Loading branch information
aleclarson authored Dec 30, 2024
1 parent 1f3b5cf commit 0798a1e
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 24 deletions.
2 changes: 1 addition & 1 deletion packages/vite-plugin-web-extension/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
"lodash.uniqby": "^4.7.0",
"md5": "^2.3.0",
"vite": "^5.0.0 || ^4.1.4",
"web-ext-option-types": "8.3.0",
"web-ext-option-types": "8.3.1",
"web-ext-run": "^0.2.1",
"webextension-polyfill": "^0.10.0",
"yaml": "^2.3.4"
Expand Down
11 changes: 9 additions & 2 deletions packages/vite-plugin-web-extension/src/options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@ import type Browser from "webextension-polyfill";

export type Manifest = any;

export type WebExtConfig = Omit<webext.RunOptions, "reload"> & {
/**
* @deprecated Use `firefoxBinary` instead.
*/
firefox?: string;
}

export interface UserOptions {
/**
* The path to your manifest.json or a function that returns your manifest as a JS object. It's a
Expand Down Expand Up @@ -86,7 +93,7 @@ export interface UserOptions {
* Optional startup configuration for web-ext. For list of options, see
* <https://github.com/mozilla/web-ext/blob/666886f40a967b515d43cf38fc9aec67ad744d89/src/program.js#L559>.
*/
webExtConfig?: webext.RunOptions;
webExtConfig?: WebExtConfig;

/**
* Output path to a JSON file containing information about the generated bundles.
Expand Down Expand Up @@ -119,7 +126,7 @@ export interface ResolvedOptions {
scriptViteConfig?: vite.InlineConfig;
verbose: boolean;
disableColors: boolean;
webExtConfig?: any;
webExtConfig?: WebExtConfig;
bundleInfoJsonPath?: string;
onBundleReady?: () => void | Promise<void>;
}
Expand Down
42 changes: 21 additions & 21 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 0798a1e

Please sign in to comment.