Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(types): add WebExtConfig type, omit reload option, deprecate firefox option #231

Merged
merged 1 commit into from
Dec 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.