wxt 0.9.0 → 0.9.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
1
  // package.json
2
- var version = "0.9.0";
2
+ var version = "0.9.1";
3
3
 
4
4
  // src/core/utils/entrypoints.ts
5
5
  import path, { relative, resolve } from "node:path";
@@ -175,12 +175,7 @@ function tsconfigPaths(config) {
175
175
  async config() {
176
176
  return {
177
177
  resolve: {
178
- alias: {
179
- "@@": config.root,
180
- "~~": config.root,
181
- "@": config.srcDir,
182
- "~": config.srcDir
183
- }
178
+ alias: config.alias
184
179
  }
185
180
  };
186
181
  }
@@ -971,7 +966,7 @@ declare module "wxt/browser" {
971
966
  const overrides = messages.map((message) => {
972
967
  return ` /**
973
968
  * ${message.description ?? "No message description."}
974
- *
969
+ *
975
970
  * "${message.message}"
976
971
  */
977
972
  getMessage(
@@ -1018,8 +1013,14 @@ async function writeMainDeclarationFile(references, config) {
1018
1013
  }
1019
1014
  async function writeTsConfigFile(mainReference, config) {
1020
1015
  const dir = config.wxtDir;
1021
- const rootPath = normalizePath2(relative3(dir, config.root));
1022
- const srcPath = normalizePath2(relative3(dir, config.srcDir));
1016
+ const getTsconfigPath = (path7) => normalizePath2(relative3(dir, path7));
1017
+ const paths = Object.entries(config.alias).flatMap(([alias, absolutePath]) => {
1018
+ const aliasPath = getTsconfigPath(absolutePath);
1019
+ return [
1020
+ ` "${alias}": ["${aliasPath}"]`,
1021
+ ` "${alias}/*": ["${aliasPath}/*"]`
1022
+ ];
1023
+ }).join(",\n");
1023
1024
  await writeFileIfDifferent(
1024
1025
  resolve6(dir, "tsconfig.json"),
1025
1026
  `{
@@ -1034,21 +1035,14 @@ async function writeTsConfigFile(mainReference, config) {
1034
1035
  "strict": true,
1035
1036
  "skipLibCheck": true,
1036
1037
  "paths": {
1037
- "@": ["${srcPath}"],
1038
- "@/*": ["${srcPath}/*"],
1039
- "~": ["${srcPath}"],
1040
- "~/*": ["${srcPath}/*"],
1041
- "@@": ["${rootPath}"],
1042
- "@@/*": ["${rootPath}/*"],
1043
- "~~": ["${rootPath}"],
1044
- "~~/*": ["${rootPath}/*"]
1038
+ ${paths}
1045
1039
  }
1046
1040
  },
1047
1041
  "include": [
1048
- "${normalizePath2(relative3(dir, config.root))}/**/*",
1049
- "./${normalizePath2(relative3(dir, mainReference))}"
1042
+ "${getTsconfigPath(config.root)}/**/*",
1043
+ "./${getTsconfigPath(mainReference)}"
1050
1044
  ],
1051
- "exclude": ["${normalizePath2(relative3(dir, config.outBaseDir))}"]
1045
+ "exclude": ["${getTsconfigPath(config.outBaseDir)}"]
1052
1046
  }`
1053
1047
  );
1054
1048
  }
@@ -1124,6 +1118,15 @@ async function getInternalConfig(inlineConfig, command) {
1124
1118
  overrides: inlineConfig.runner,
1125
1119
  defaults: userConfig.runner
1126
1120
  });
1121
+ const alias = Object.fromEntries(
1122
+ Object.entries({
1123
+ ...mergedConfig.alias,
1124
+ "@": srcDir,
1125
+ "~": srcDir,
1126
+ "@@": root,
1127
+ "~~": root
1128
+ }).map(([key, value]) => [key, path5.resolve(root, value)])
1129
+ );
1127
1130
  const finalConfig = {
1128
1131
  browser,
1129
1132
  command,
@@ -1155,7 +1158,8 @@ async function getInternalConfig(inlineConfig, command) {
1155
1158
  enabled: mergedConfig.analysis?.enabled ?? false,
1156
1159
  template: mergedConfig.analysis?.template ?? "treemap"
1157
1160
  },
1158
- userConfigMetadata: userConfigMetadata ?? {}
1161
+ userConfigMetadata: userConfigMetadata ?? {},
1162
+ alias
1159
1163
  };
1160
1164
  finalConfig.vite = (env2) => resolveInternalViteConfig(env2, mergedConfig, finalConfig);
1161
1165
  return finalConfig;
@@ -1212,6 +1216,10 @@ function mergeInlineConfig(inlineConfig, userConfig) {
1212
1216
  analysis: {
1213
1217
  enabled: inlineConfig.analysis?.enabled ?? userConfig.analysis?.enabled,
1214
1218
  template: inlineConfig.analysis?.template ?? userConfig.analysis?.template
1219
+ },
1220
+ alias: {
1221
+ ...userConfig.alias,
1222
+ ...inlineConfig.alias
1215
1223
  }
1216
1224
  };
1217
1225
  }
@@ -1700,7 +1708,12 @@ function addEntrypoints(manifest, entrypoints, buildOutput, config) {
1700
1708
  const sidepanels = entriesByType["sidepanel"];
1701
1709
  if (background) {
1702
1710
  const script = getEntrypointBundlePath(background, config.outDir, ".js");
1703
- if (manifest.manifest_version === 3) {
1711
+ if (config.browser === "firefox" && config.manifestVersion === 3) {
1712
+ manifest.background = {
1713
+ type: background.options.type,
1714
+ scripts: [script]
1715
+ };
1716
+ } else if (config.manifestVersion === 3) {
1704
1717
  manifest.background = {
1705
1718
  type: background.options.type,
1706
1719
  service_worker: script
package/dist/cli.cjs CHANGED
@@ -2415,7 +2415,7 @@ var init_execa = __esm({
2415
2415
  var import_cac = __toESM(require("cac"), 1);
2416
2416
 
2417
2417
  // package.json
2418
- var version = "0.9.0";
2418
+ var version = "0.9.1";
2419
2419
 
2420
2420
  // src/core/utils/building/build-entrypoints.ts
2421
2421
  var vite2 = __toESM(require("vite"), 1);
@@ -2809,12 +2809,7 @@ function tsconfigPaths(config) {
2809
2809
  async config() {
2810
2810
  return {
2811
2811
  resolve: {
2812
- alias: {
2813
- "@@": config.root,
2814
- "~~": config.root,
2815
- "@": config.srcDir,
2816
- "~": config.srcDir
2817
- }
2812
+ alias: config.alias
2818
2813
  }
2819
2814
  };
2820
2815
  }
@@ -3649,7 +3644,7 @@ declare module "wxt/browser" {
3649
3644
  const overrides = messages.map((message) => {
3650
3645
  return ` /**
3651
3646
  * ${message.description ?? "No message description."}
3652
- *
3647
+ *
3653
3648
  * "${message.message}"
3654
3649
  */
3655
3650
  getMessage(
@@ -3696,8 +3691,14 @@ async function writeMainDeclarationFile(references, config) {
3696
3691
  }
3697
3692
  async function writeTsConfigFile(mainReference, config) {
3698
3693
  const dir = config.wxtDir;
3699
- const rootPath = normalizePath2((0, import_path6.relative)(dir, config.root));
3700
- const srcPath = normalizePath2((0, import_path6.relative)(dir, config.srcDir));
3694
+ const getTsconfigPath = (path11) => normalizePath2((0, import_path6.relative)(dir, path11));
3695
+ const paths = Object.entries(config.alias).flatMap(([alias, absolutePath]) => {
3696
+ const aliasPath = getTsconfigPath(absolutePath);
3697
+ return [
3698
+ ` "${alias}": ["${aliasPath}"]`,
3699
+ ` "${alias}/*": ["${aliasPath}/*"]`
3700
+ ];
3701
+ }).join(",\n");
3701
3702
  await writeFileIfDifferent(
3702
3703
  (0, import_path6.resolve)(dir, "tsconfig.json"),
3703
3704
  `{
@@ -3712,21 +3713,14 @@ async function writeTsConfigFile(mainReference, config) {
3712
3713
  "strict": true,
3713
3714
  "skipLibCheck": true,
3714
3715
  "paths": {
3715
- "@": ["${srcPath}"],
3716
- "@/*": ["${srcPath}/*"],
3717
- "~": ["${srcPath}"],
3718
- "~/*": ["${srcPath}/*"],
3719
- "@@": ["${rootPath}"],
3720
- "@@/*": ["${rootPath}/*"],
3721
- "~~": ["${rootPath}"],
3722
- "~~/*": ["${rootPath}/*"]
3716
+ ${paths}
3723
3717
  }
3724
3718
  },
3725
3719
  "include": [
3726
- "${normalizePath2((0, import_path6.relative)(dir, config.root))}/**/*",
3727
- "./${normalizePath2((0, import_path6.relative)(dir, mainReference))}"
3720
+ "${getTsconfigPath(config.root)}/**/*",
3721
+ "./${getTsconfigPath(mainReference)}"
3728
3722
  ],
3729
- "exclude": ["${normalizePath2((0, import_path6.relative)(dir, config.outBaseDir))}"]
3723
+ "exclude": ["${getTsconfigPath(config.outBaseDir)}"]
3730
3724
  }`
3731
3725
  );
3732
3726
  }
@@ -3802,6 +3796,15 @@ async function getInternalConfig(inlineConfig, command) {
3802
3796
  overrides: inlineConfig.runner,
3803
3797
  defaults: userConfig.runner
3804
3798
  });
3799
+ const alias = Object.fromEntries(
3800
+ Object.entries({
3801
+ ...mergedConfig.alias,
3802
+ "@": srcDir,
3803
+ "~": srcDir,
3804
+ "@@": root,
3805
+ "~~": root
3806
+ }).map(([key, value]) => [key, import_node_path7.default.resolve(root, value)])
3807
+ );
3805
3808
  const finalConfig = {
3806
3809
  browser,
3807
3810
  command,
@@ -3833,7 +3836,8 @@ async function getInternalConfig(inlineConfig, command) {
3833
3836
  enabled: mergedConfig.analysis?.enabled ?? false,
3834
3837
  template: mergedConfig.analysis?.template ?? "treemap"
3835
3838
  },
3836
- userConfigMetadata: userConfigMetadata ?? {}
3839
+ userConfigMetadata: userConfigMetadata ?? {},
3840
+ alias
3837
3841
  };
3838
3842
  finalConfig.vite = (env2) => resolveInternalViteConfig(env2, mergedConfig, finalConfig);
3839
3843
  return finalConfig;
@@ -3890,6 +3894,10 @@ function mergeInlineConfig(inlineConfig, userConfig) {
3890
3894
  analysis: {
3891
3895
  enabled: inlineConfig.analysis?.enabled ?? userConfig.analysis?.enabled,
3892
3896
  template: inlineConfig.analysis?.template ?? userConfig.analysis?.template
3897
+ },
3898
+ alias: {
3899
+ ...userConfig.alias,
3900
+ ...inlineConfig.alias
3893
3901
  }
3894
3902
  };
3895
3903
  }
@@ -4382,7 +4390,12 @@ function addEntrypoints(manifest, entrypoints, buildOutput, config) {
4382
4390
  const sidepanels = entriesByType["sidepanel"];
4383
4391
  if (background) {
4384
4392
  const script = getEntrypointBundlePath(background, config.outDir, ".js");
4385
- if (manifest.manifest_version === 3) {
4393
+ if (config.browser === "firefox" && config.manifestVersion === 3) {
4394
+ manifest.background = {
4395
+ type: background.options.type,
4396
+ scripts: [script]
4397
+ };
4398
+ } else if (config.manifestVersion === 3) {
4386
4399
  manifest.background = {
4387
4400
  type: background.options.type,
4388
4401
  service_worker: script
@@ -4834,6 +4847,11 @@ function createWebExtRunner() {
4834
4847
  return {
4835
4848
  async openBrowser(config) {
4836
4849
  config.logger.info("Opening browser...");
4850
+ if (config.browser === "firefox" && config.manifestVersion === 3) {
4851
+ throw Error(
4852
+ "Dev mode does not support Firefox MV3. For alternatives, see https://github.com/wxt-dev/wxt/issues/230#issuecomment-1806881653"
4853
+ );
4854
+ }
4837
4855
  const webExtLogger = await import("web-ext-run/util/logger");
4838
4856
  webExtLogger.consoleStream.write = ({ level, msg, name }) => {
4839
4857
  if (level >= ERROR_LOG_LEVEL)
@@ -268,6 +268,22 @@ interface InlineConfig {
268
268
  */
269
269
  template?: PluginVisualizerOptions['template'];
270
270
  };
271
+ /**
272
+ * Add additional paths to the `.wxt/tsconfig.json`. Use this instead of overwriting the `paths`
273
+ * in the root `tsconfig.json` if you want to add new paths.
274
+ *
275
+ * Passed into Vite's
276
+ * [`resolve.alias`](https://vitejs.dev/config/shared-options.html#resolve-alias) option and used
277
+ * to generate the `.wxt/tsconfig.json`.
278
+ *
279
+ * The key is the import alias and the value is either a relative path to the root directory or an absolute path.
280
+ *
281
+ * @example
282
+ * {
283
+ * "testing": "src/utils/testing.ts"
284
+ * }
285
+ */
286
+ alias?: Record<string, string>;
271
287
  }
272
288
  interface WxtInlineViteConfig extends Omit<vite.InlineConfig, 'root' | 'configFile' | 'mode' | 'build'> {
273
289
  build?: Omit<vite.BuildOptions, 'outDir'>;
package/dist/index.cjs CHANGED
@@ -2819,12 +2819,7 @@ function tsconfigPaths(config) {
2819
2819
  async config() {
2820
2820
  return {
2821
2821
  resolve: {
2822
- alias: {
2823
- "@@": config.root,
2824
- "~~": config.root,
2825
- "@": config.srcDir,
2826
- "~": config.srcDir
2827
- }
2822
+ alias: config.alias
2828
2823
  }
2829
2824
  };
2830
2825
  }
@@ -3659,7 +3654,7 @@ declare module "wxt/browser" {
3659
3654
  const overrides = messages.map((message) => {
3660
3655
  return ` /**
3661
3656
  * ${message.description ?? "No message description."}
3662
- *
3657
+ *
3663
3658
  * "${message.message}"
3664
3659
  */
3665
3660
  getMessage(
@@ -3706,8 +3701,14 @@ async function writeMainDeclarationFile(references, config) {
3706
3701
  }
3707
3702
  async function writeTsConfigFile(mainReference, config) {
3708
3703
  const dir = config.wxtDir;
3709
- const rootPath = normalizePath2((0, import_path6.relative)(dir, config.root));
3710
- const srcPath = normalizePath2((0, import_path6.relative)(dir, config.srcDir));
3704
+ const getTsconfigPath = (path11) => normalizePath2((0, import_path6.relative)(dir, path11));
3705
+ const paths = Object.entries(config.alias).flatMap(([alias, absolutePath]) => {
3706
+ const aliasPath = getTsconfigPath(absolutePath);
3707
+ return [
3708
+ ` "${alias}": ["${aliasPath}"]`,
3709
+ ` "${alias}/*": ["${aliasPath}/*"]`
3710
+ ];
3711
+ }).join(",\n");
3711
3712
  await writeFileIfDifferent(
3712
3713
  (0, import_path6.resolve)(dir, "tsconfig.json"),
3713
3714
  `{
@@ -3722,21 +3723,14 @@ async function writeTsConfigFile(mainReference, config) {
3722
3723
  "strict": true,
3723
3724
  "skipLibCheck": true,
3724
3725
  "paths": {
3725
- "@": ["${srcPath}"],
3726
- "@/*": ["${srcPath}/*"],
3727
- "~": ["${srcPath}"],
3728
- "~/*": ["${srcPath}/*"],
3729
- "@@": ["${rootPath}"],
3730
- "@@/*": ["${rootPath}/*"],
3731
- "~~": ["${rootPath}"],
3732
- "~~/*": ["${rootPath}/*"]
3726
+ ${paths}
3733
3727
  }
3734
3728
  },
3735
3729
  "include": [
3736
- "${normalizePath2((0, import_path6.relative)(dir, config.root))}/**/*",
3737
- "./${normalizePath2((0, import_path6.relative)(dir, mainReference))}"
3730
+ "${getTsconfigPath(config.root)}/**/*",
3731
+ "./${getTsconfigPath(mainReference)}"
3738
3732
  ],
3739
- "exclude": ["${normalizePath2((0, import_path6.relative)(dir, config.outBaseDir))}"]
3733
+ "exclude": ["${getTsconfigPath(config.outBaseDir)}"]
3740
3734
  }`
3741
3735
  );
3742
3736
  }
@@ -3812,6 +3806,15 @@ async function getInternalConfig(inlineConfig, command) {
3812
3806
  overrides: inlineConfig.runner,
3813
3807
  defaults: userConfig.runner
3814
3808
  });
3809
+ const alias = Object.fromEntries(
3810
+ Object.entries({
3811
+ ...mergedConfig.alias,
3812
+ "@": srcDir,
3813
+ "~": srcDir,
3814
+ "@@": root,
3815
+ "~~": root
3816
+ }).map(([key, value]) => [key, import_node_path7.default.resolve(root, value)])
3817
+ );
3815
3818
  const finalConfig = {
3816
3819
  browser,
3817
3820
  command,
@@ -3843,7 +3846,8 @@ async function getInternalConfig(inlineConfig, command) {
3843
3846
  enabled: mergedConfig.analysis?.enabled ?? false,
3844
3847
  template: mergedConfig.analysis?.template ?? "treemap"
3845
3848
  },
3846
- userConfigMetadata: userConfigMetadata ?? {}
3849
+ userConfigMetadata: userConfigMetadata ?? {},
3850
+ alias
3847
3851
  };
3848
3852
  finalConfig.vite = (env2) => resolveInternalViteConfig(env2, mergedConfig, finalConfig);
3849
3853
  return finalConfig;
@@ -3900,6 +3904,10 @@ function mergeInlineConfig(inlineConfig, userConfig) {
3900
3904
  analysis: {
3901
3905
  enabled: inlineConfig.analysis?.enabled ?? userConfig.analysis?.enabled,
3902
3906
  template: inlineConfig.analysis?.template ?? userConfig.analysis?.template
3907
+ },
3908
+ alias: {
3909
+ ...userConfig.alias,
3910
+ ...inlineConfig.alias
3903
3911
  }
3904
3912
  };
3905
3913
  }
@@ -4184,7 +4192,7 @@ function getChunkSortWeight(filename) {
4184
4192
  var import_picocolors3 = __toESM(require("picocolors"), 1);
4185
4193
 
4186
4194
  // package.json
4187
- var version = "0.9.0";
4195
+ var version = "0.9.1";
4188
4196
 
4189
4197
  // src/core/utils/log/printHeader.ts
4190
4198
  var import_consola2 = require("consola");
@@ -4393,7 +4401,12 @@ function addEntrypoints(manifest, entrypoints, buildOutput, config) {
4393
4401
  const sidepanels = entriesByType["sidepanel"];
4394
4402
  if (background) {
4395
4403
  const script = getEntrypointBundlePath(background, config.outDir, ".js");
4396
- if (manifest.manifest_version === 3) {
4404
+ if (config.browser === "firefox" && config.manifestVersion === 3) {
4405
+ manifest.background = {
4406
+ type: background.options.type,
4407
+ scripts: [script]
4408
+ };
4409
+ } else if (config.manifestVersion === 3) {
4397
4410
  manifest.background = {
4398
4411
  type: background.options.type,
4399
4412
  service_worker: script
@@ -4855,6 +4868,11 @@ function createWebExtRunner() {
4855
4868
  return {
4856
4869
  async openBrowser(config) {
4857
4870
  config.logger.info("Opening browser...");
4871
+ if (config.browser === "firefox" && config.manifestVersion === 3) {
4872
+ throw Error(
4873
+ "Dev mode does not support Firefox MV3. For alternatives, see https://github.com/wxt-dev/wxt/issues/230#issuecomment-1806881653"
4874
+ );
4875
+ }
4858
4876
  const webExtLogger = await import("web-ext-run/util/logger");
4859
4877
  webExtLogger.consoleStream.write = ({ level, msg, name }) => {
4860
4878
  if (level >= ERROR_LOG_LEVEL)
package/dist/index.d.cts CHANGED
@@ -1,5 +1,5 @@
1
- import { I as InlineConfig, B as BuildOutput, U as UserConfig, E as ExtensionRunnerConfig, W as WxtDevServer } from './external-cb0967d6.js';
2
- export { k as BackgroundDefinition, f as BackgroundEntrypoint, e as BaseEntrypoint, d as BaseEntrypointOptions, b as BuildStepOutput, q as ConfigEnv, j as ContentScriptDefinition, C as ContentScriptEntrypoint, g as Entrypoint, h as EntrypointGroup, n as ExcludableEntrypoint, G as GenericEntrypoint, L as Logger, i as OnContentScriptStopped, O as OptionsEntrypoint, m as PerBrowserOption, P as PopupEntrypoint, T as TargetBrowser, c as TargetManifestVersion, l as UnlistedScriptDefinition, o as UserManifest, p as UserManifestFn, a as WxtInlineViteConfig, r as WxtViteConfig } from './external-cb0967d6.js';
1
+ import { I as InlineConfig, B as BuildOutput, U as UserConfig, E as ExtensionRunnerConfig, W as WxtDevServer } from './external-9e212597.js';
2
+ export { k as BackgroundDefinition, f as BackgroundEntrypoint, e as BaseEntrypoint, d as BaseEntrypointOptions, b as BuildStepOutput, q as ConfigEnv, j as ContentScriptDefinition, C as ContentScriptEntrypoint, g as Entrypoint, h as EntrypointGroup, n as ExcludableEntrypoint, G as GenericEntrypoint, L as Logger, i as OnContentScriptStopped, O as OptionsEntrypoint, m as PerBrowserOption, P as PopupEntrypoint, T as TargetBrowser, c as TargetManifestVersion, l as UnlistedScriptDefinition, o as UserManifest, p as UserManifestFn, a as WxtInlineViteConfig, r as WxtViteConfig } from './external-9e212597.js';
3
3
  import 'vite';
4
4
  import 'webextension-polyfill';
5
5
  import 'unimport';
@@ -61,6 +61,6 @@ declare function prepare(config: InlineConfig): Promise<void>;
61
61
  */
62
62
  declare function zip(config?: InlineConfig): Promise<string[]>;
63
63
 
64
- var version = "0.9.0";
64
+ var version = "0.9.1";
65
65
 
66
66
  export { BuildOutput, ExtensionRunnerConfig, InlineConfig, UserConfig, WxtDevServer, build, clean, createServer, defineConfig, defineRunnerConfig, initialize, prepare, version, zip };
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { I as InlineConfig, B as BuildOutput, U as UserConfig, E as ExtensionRunnerConfig, W as WxtDevServer } from './external-cb0967d6.js';
2
- export { k as BackgroundDefinition, f as BackgroundEntrypoint, e as BaseEntrypoint, d as BaseEntrypointOptions, b as BuildStepOutput, q as ConfigEnv, j as ContentScriptDefinition, C as ContentScriptEntrypoint, g as Entrypoint, h as EntrypointGroup, n as ExcludableEntrypoint, G as GenericEntrypoint, L as Logger, i as OnContentScriptStopped, O as OptionsEntrypoint, m as PerBrowserOption, P as PopupEntrypoint, T as TargetBrowser, c as TargetManifestVersion, l as UnlistedScriptDefinition, o as UserManifest, p as UserManifestFn, a as WxtInlineViteConfig, r as WxtViteConfig } from './external-cb0967d6.js';
1
+ import { I as InlineConfig, B as BuildOutput, U as UserConfig, E as ExtensionRunnerConfig, W as WxtDevServer } from './external-9e212597.js';
2
+ export { k as BackgroundDefinition, f as BackgroundEntrypoint, e as BaseEntrypoint, d as BaseEntrypointOptions, b as BuildStepOutput, q as ConfigEnv, j as ContentScriptDefinition, C as ContentScriptEntrypoint, g as Entrypoint, h as EntrypointGroup, n as ExcludableEntrypoint, G as GenericEntrypoint, L as Logger, i as OnContentScriptStopped, O as OptionsEntrypoint, m as PerBrowserOption, P as PopupEntrypoint, T as TargetBrowser, c as TargetManifestVersion, l as UnlistedScriptDefinition, o as UserManifest, p as UserManifestFn, a as WxtInlineViteConfig, r as WxtViteConfig } from './external-9e212597.js';
3
3
  import 'vite';
4
4
  import 'webextension-polyfill';
5
5
  import 'unimport';
@@ -61,6 +61,6 @@ declare function prepare(config: InlineConfig): Promise<void>;
61
61
  */
62
62
  declare function zip(config?: InlineConfig): Promise<string[]>;
63
63
 
64
- var version = "0.9.0";
64
+ var version = "0.9.1";
65
65
 
66
66
  export { BuildOutput, ExtensionRunnerConfig, InlineConfig, UserConfig, WxtDevServer, build, clean, createServer, defineConfig, defineRunnerConfig, initialize, prepare, version, zip };
package/dist/index.js CHANGED
@@ -15,7 +15,7 @@ import {
15
15
  rebuild,
16
16
  resolvePerBrowserOption,
17
17
  version
18
- } from "./chunk-TCKBDQAK.js";
18
+ } from "./chunk-2BIYR4TE.js";
19
19
  import "./chunk-YUG22S6W.js";
20
20
 
21
21
  // src/core/build.ts
@@ -95,6 +95,11 @@ function createWebExtRunner() {
95
95
  return {
96
96
  async openBrowser(config) {
97
97
  config.logger.info("Opening browser...");
98
+ if (config.browser === "firefox" && config.manifestVersion === 3) {
99
+ throw Error(
100
+ "Dev mode does not support Firefox MV3. For alternatives, see https://github.com/wxt-dev/wxt/issues/230#issuecomment-1806881653"
101
+ );
102
+ }
98
103
  const webExtLogger = await import("web-ext-run/util/logger");
99
104
  webExtLogger.consoleStream.write = ({ level, msg, name }) => {
100
105
  if (level >= ERROR_LOG_LEVEL)
package/dist/testing.cjs CHANGED
@@ -362,12 +362,7 @@ function tsconfigPaths(config) {
362
362
  async config() {
363
363
  return {
364
364
  resolve: {
365
- alias: {
366
- "@@": config.root,
367
- "~~": config.root,
368
- "@": config.srcDir,
369
- "~": config.srcDir
370
- }
365
+ alias: config.alias
371
366
  }
372
367
  };
373
368
  }
@@ -651,6 +646,15 @@ async function getInternalConfig(inlineConfig, command) {
651
646
  overrides: inlineConfig.runner,
652
647
  defaults: userConfig.runner
653
648
  });
649
+ const alias = Object.fromEntries(
650
+ Object.entries({
651
+ ...mergedConfig.alias,
652
+ "@": srcDir,
653
+ "~": srcDir,
654
+ "@@": root,
655
+ "~~": root
656
+ }).map(([key, value]) => [key, import_node_path7.default.resolve(root, value)])
657
+ );
654
658
  const finalConfig = {
655
659
  browser,
656
660
  command,
@@ -682,7 +686,8 @@ async function getInternalConfig(inlineConfig, command) {
682
686
  enabled: mergedConfig.analysis?.enabled ?? false,
683
687
  template: mergedConfig.analysis?.template ?? "treemap"
684
688
  },
685
- userConfigMetadata: userConfigMetadata ?? {}
689
+ userConfigMetadata: userConfigMetadata ?? {},
690
+ alias
686
691
  };
687
692
  finalConfig.vite = (env2) => resolveInternalViteConfig(env2, mergedConfig, finalConfig);
688
693
  return finalConfig;
@@ -739,6 +744,10 @@ function mergeInlineConfig(inlineConfig, userConfig) {
739
744
  analysis: {
740
745
  enabled: inlineConfig.analysis?.enabled ?? userConfig.analysis?.enabled,
741
746
  template: inlineConfig.analysis?.template ?? userConfig.analysis?.template
747
+ },
748
+ alias: {
749
+ ...userConfig.alias,
750
+ ...inlineConfig.alias
742
751
  }
743
752
  };
744
753
  }
@@ -1,6 +1,6 @@
1
1
  export { FakeBrowser, fakeBrowser } from '@webext-core/fake-browser';
2
2
  import * as vite from 'vite';
3
- import { I as InlineConfig } from './external-cb0967d6.js';
3
+ import { I as InlineConfig } from './external-9e212597.js';
4
4
  import 'webextension-polyfill';
5
5
  import 'unimport';
6
6
  import 'consola';
package/dist/testing.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  export { FakeBrowser, fakeBrowser } from '@webext-core/fake-browser';
2
2
  import * as vite from 'vite';
3
- import { I as InlineConfig } from './external-cb0967d6.js';
3
+ import { I as InlineConfig } from './external-9e212597.js';
4
4
  import 'webextension-polyfill';
5
5
  import 'unimport';
6
6
  import 'consola';
package/dist/testing.js CHANGED
@@ -6,7 +6,7 @@ import {
6
6
  unimport,
7
7
  webextensionPolyfillAlias,
8
8
  webextensionPolyfillInlineDeps
9
- } from "./chunk-TCKBDQAK.js";
9
+ } from "./chunk-2BIYR4TE.js";
10
10
  import "./chunk-YUG22S6W.js";
11
11
 
12
12
  // src/testing/fake-browser.ts
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "wxt",
3
3
  "type": "module",
4
- "version": "0.9.0",
4
+ "version": "0.9.1",
5
5
  "description": "Next gen framework for developing web extensions",
6
6
  "engines": {
7
7
  "node": ">=18",
@@ -84,7 +84,7 @@
84
84
  "prompts": "^2.4.2",
85
85
  "rollup-plugin-visualizer": "^5.9.2",
86
86
  "unimport": "^3.4.0",
87
- "vite": "^4.5.0",
87
+ "vite": "^4.0.0 || ^5.0.0-0",
88
88
  "web-ext-run": "^0.1.0",
89
89
  "webextension-polyfill": "^0.10.0",
90
90
  "zip-dir": "^2.0.0"
@@ -113,11 +113,7 @@
113
113
  "vitepress": "1.0.0-rc.24",
114
114
  "vitest": "^0.34.6",
115
115
  "vitest-mock-extended": "^1.3.1",
116
- "vue": "^3.3.7",
117
- "webextension-polyfill": "^0.10.0"
118
- },
119
- "peerDependencies": {
120
- "webextension-polyfill": ">=0.10.0"
116
+ "vue": "^3.3.7"
121
117
  },
122
118
  "packageManager": "pnpm@8.6.3",
123
119
  "simple-git-hooks": {