Skip to content

Commit 0798a1e

Browse files
authored
fix(types): add WebExtConfig type, omit reload option, deprecate firefox option (#231)
1 parent 1f3b5cf commit 0798a1e

File tree

3 files changed

+31
-24
lines changed

3 files changed

+31
-24
lines changed

packages/vite-plugin-web-extension/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
"lodash.uniqby": "^4.7.0",
5050
"md5": "^2.3.0",
5151
"vite": "^5.0.0 || ^4.1.4",
52-
"web-ext-option-types": "8.3.0",
52+
"web-ext-option-types": "8.3.1",
5353
"web-ext-run": "^0.2.1",
5454
"webextension-polyfill": "^0.10.0",
5555
"yaml": "^2.3.4"

packages/vite-plugin-web-extension/src/options.ts

+9-2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,13 @@ import type Browser from "webextension-polyfill";
44

55
export type Manifest = any;
66

7+
export type WebExtConfig = Omit<webext.RunOptions, "reload"> & {
8+
/**
9+
* @deprecated Use `firefoxBinary` instead.
10+
*/
11+
firefox?: string;
12+
}
13+
714
export interface UserOptions {
815
/**
916
* The path to your manifest.json or a function that returns your manifest as a JS object. It's a
@@ -86,7 +93,7 @@ export interface UserOptions {
8693
* Optional startup configuration for web-ext. For list of options, see
8794
* <https://github.com/mozilla/web-ext/blob/666886f40a967b515d43cf38fc9aec67ad744d89/src/program.js#L559>.
8895
*/
89-
webExtConfig?: webext.RunOptions;
96+
webExtConfig?: WebExtConfig;
9097

9198
/**
9299
* Output path to a JSON file containing information about the generated bundles.
@@ -119,7 +126,7 @@ export interface ResolvedOptions {
119126
scriptViteConfig?: vite.InlineConfig;
120127
verbose: boolean;
121128
disableColors: boolean;
122-
webExtConfig?: any;
129+
webExtConfig?: WebExtConfig;
123130
bundleInfoJsonPath?: string;
124131
onBundleReady?: () => void | Promise<void>;
125132
}

pnpm-lock.yaml

+21-21
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)