wxt 0.16.3 → 0.16.5

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.
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 './index-wltPoSyr.cjs';
2
- export { q as BackgroundDefinition, h as BackgroundEntrypoint, g as BaseEntrypoint, f as BaseEntrypointOptions, d as BuildStepOutput, w as ConfigEnv, p as ContentScriptBaseDefinition, m as ContentScriptDefinition, C as ContentScriptEntrypoint, n as ContentScriptIsolatedWorldDefinition, o as ContentScriptMainWorldDefinition, j as Entrypoint, k as EntrypointGroup, t as ExcludableEntrypoint, D as ExtensionRunner, F as FsCache, G as GenericEntrypoint, H as HookResult, L as Logger, l as OnContentScriptStopped, i as OptionsEntrypoint, c as OutputAsset, b as OutputChunk, O as OutputFile, s as PerBrowserOption, P as PopupEntrypoint, R as ResolvedConfig, S as ServerInfo, T as TargetBrowser, e as TargetManifestVersion, r as UnlistedScriptDefinition, u as UserManifest, v as UserManifestFn, V as VirtualEntrypointType, A as Wxt, x as WxtBuilder, y as WxtBuilderServer, z as WxtHooks, a as WxtViteConfig } from './index-wltPoSyr.cjs';
1
+ import { I as InlineConfig, B as BuildOutput, U as UserConfig, E as ExtensionRunnerConfig, W as WxtDevServer } from './index-znx-ff-l.cjs';
2
+ export { q as BackgroundDefinition, h as BackgroundEntrypoint, g as BaseEntrypoint, f as BaseEntrypointOptions, d as BuildStepOutput, w as ConfigEnv, p as ContentScriptBaseDefinition, m as ContentScriptDefinition, C as ContentScriptEntrypoint, n as ContentScriptIsolatedWorldDefinition, o as ContentScriptMainWorldDefinition, j as Entrypoint, k as EntrypointGroup, t as ExcludableEntrypoint, D as ExtensionRunner, F as FsCache, G as GenericEntrypoint, H as HookResult, L as Logger, l as OnContentScriptStopped, i as OptionsEntrypoint, c as OutputAsset, b as OutputChunk, O as OutputFile, s as PerBrowserOption, P as PopupEntrypoint, R as ResolvedConfig, S as ServerInfo, T as TargetBrowser, e as TargetManifestVersion, r as UnlistedScriptDefinition, u as UserManifest, v as UserManifestFn, V as VirtualEntrypointType, A as Wxt, x as WxtBuilder, y as WxtBuilderServer, z as WxtHooks, a as WxtViteConfig } from './index-znx-ff-l.cjs';
3
3
  import 'vite';
4
4
  import 'webextension-polyfill';
5
5
  import 'unimport';
@@ -64,6 +64,6 @@ declare function prepare(config: InlineConfig): Promise<void>;
64
64
  */
65
65
  declare function zip(config?: InlineConfig): Promise<string[]>;
66
66
 
67
- var version = "0.16.3";
67
+ var version = "0.16.5";
68
68
 
69
69
  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 './index-wltPoSyr.js';
2
- export { q as BackgroundDefinition, h as BackgroundEntrypoint, g as BaseEntrypoint, f as BaseEntrypointOptions, d as BuildStepOutput, w as ConfigEnv, p as ContentScriptBaseDefinition, m as ContentScriptDefinition, C as ContentScriptEntrypoint, n as ContentScriptIsolatedWorldDefinition, o as ContentScriptMainWorldDefinition, j as Entrypoint, k as EntrypointGroup, t as ExcludableEntrypoint, D as ExtensionRunner, F as FsCache, G as GenericEntrypoint, H as HookResult, L as Logger, l as OnContentScriptStopped, i as OptionsEntrypoint, c as OutputAsset, b as OutputChunk, O as OutputFile, s as PerBrowserOption, P as PopupEntrypoint, R as ResolvedConfig, S as ServerInfo, T as TargetBrowser, e as TargetManifestVersion, r as UnlistedScriptDefinition, u as UserManifest, v as UserManifestFn, V as VirtualEntrypointType, A as Wxt, x as WxtBuilder, y as WxtBuilderServer, z as WxtHooks, a as WxtViteConfig } from './index-wltPoSyr.js';
1
+ import { I as InlineConfig, B as BuildOutput, U as UserConfig, E as ExtensionRunnerConfig, W as WxtDevServer } from './index-znx-ff-l.js';
2
+ export { q as BackgroundDefinition, h as BackgroundEntrypoint, g as BaseEntrypoint, f as BaseEntrypointOptions, d as BuildStepOutput, w as ConfigEnv, p as ContentScriptBaseDefinition, m as ContentScriptDefinition, C as ContentScriptEntrypoint, n as ContentScriptIsolatedWorldDefinition, o as ContentScriptMainWorldDefinition, j as Entrypoint, k as EntrypointGroup, t as ExcludableEntrypoint, D as ExtensionRunner, F as FsCache, G as GenericEntrypoint, H as HookResult, L as Logger, l as OnContentScriptStopped, i as OptionsEntrypoint, c as OutputAsset, b as OutputChunk, O as OutputFile, s as PerBrowserOption, P as PopupEntrypoint, R as ResolvedConfig, S as ServerInfo, T as TargetBrowser, e as TargetManifestVersion, r as UnlistedScriptDefinition, u as UserManifest, v as UserManifestFn, V as VirtualEntrypointType, A as Wxt, x as WxtBuilder, y as WxtBuilderServer, z as WxtHooks, a as WxtViteConfig } from './index-znx-ff-l.js';
3
3
  import 'vite';
4
4
  import 'webextension-polyfill';
5
5
  import 'unimport';
@@ -64,6 +64,6 @@ declare function prepare(config: InlineConfig): Promise<void>;
64
64
  */
65
65
  declare function zip(config?: InlineConfig): Promise<string[]>;
66
66
 
67
- var version = "0.16.3";
67
+ var version = "0.16.5";
68
68
 
69
69
  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
  resolvePerBrowserOption,
16
16
  version,
17
17
  wxt
18
- } from "./chunk-4IVGHIAG.js";
18
+ } from "./chunk-N5MSLHHE.js";
19
19
  import "./chunk-VBXJIVYU.js";
20
20
 
21
21
  // src/core/build.ts
package/dist/testing.cjs CHANGED
@@ -44,8 +44,8 @@ var import_node_path2 = __toESM(require("path"), 1);
44
44
  // src/core/utils/paths.ts
45
45
  var import_node_path = __toESM(require("path"), 1);
46
46
  var import_normalize_path = __toESM(require("normalize-path"), 1);
47
- function normalizePath(path6) {
48
- return (0, import_normalize_path.default)(path6);
47
+ function normalizePath(path7) {
48
+ return (0, import_normalize_path.default)(path7);
49
49
  }
50
50
  var CSS_EXTENSIONS = ["css", "scss", "sass", "less", "styl", "stylus"];
51
51
  var CSS_EXTENSIONS_PATTERN = `+(${CSS_EXTENSIONS.join("|")})`;
@@ -188,10 +188,10 @@ function pointToDevServer(config, server, id, document, querySelector, attr) {
188
188
  (0, import_node_path3.relative)(config.root, resolvedAbsolutePath)
189
189
  );
190
190
  if (relativePath.startsWith(".")) {
191
- let path6 = normalizePath(resolvedAbsolutePath);
192
- if (!path6.startsWith("/"))
193
- path6 = "/" + path6;
194
- element.setAttribute(attr, `${server.origin}/@fs${path6}`);
191
+ let path7 = normalizePath(resolvedAbsolutePath);
192
+ if (!path7.startsWith("/"))
193
+ path7 = "/" + path7;
194
+ element.setAttribute(attr, `${server.origin}/@fs${path7}`);
195
195
  } else {
196
196
  const url = new URL(relativePath, server.origin);
197
197
  element.setAttribute(attr, url.href);
@@ -507,12 +507,12 @@ function cssEntrypoints(entrypoint, config) {
507
507
 
508
508
  // src/core/builders/vite/plugins/bundleAnalysis.ts
509
509
  var import_rollup_plugin_visualizer = require("rollup-plugin-visualizer");
510
+ var import_node_path5 = __toESM(require("path"), 1);
510
511
  var increment = 0;
511
- function bundleAnalysis() {
512
+ function bundleAnalysis(config) {
512
513
  return (0, import_rollup_plugin_visualizer.visualizer)({
513
- emitFile: true,
514
514
  template: "raw-data",
515
- filename: `stats-${increment++}.json`
515
+ filename: import_node_path5.default.resolve(config.outDir, `stats-${increment++}.json`)
516
516
  });
517
517
  }
518
518
 
@@ -588,7 +588,7 @@ function globals(config) {
588
588
  }
589
589
 
590
590
  // src/core/builders/vite/plugins/webextensionPolyfillMock.ts
591
- var import_node_path5 = __toESM(require("path"), 1);
591
+ var import_node_path6 = __toESM(require("path"), 1);
592
592
  function webextensionPolyfillMock(config) {
593
593
  return {
594
594
  name: "wxt:testing-inline-deps",
@@ -597,7 +597,7 @@ function webextensionPolyfillMock(config) {
597
597
  resolve: {
598
598
  alias: {
599
599
  // Alias to use a mocked version of the polyfill
600
- "webextension-polyfill": import_node_path5.default.resolve(
600
+ "webextension-polyfill": import_node_path6.default.resolve(
601
601
  config.root,
602
602
  "node_modules/wxt/dist/virtual/mock-browser"
603
603
  )
@@ -737,11 +737,11 @@ var PATH_GLOB_TO_TYPE_MAP = {
737
737
  // src/core/utils/building/generate-wxt-dir.ts
738
738
  var import_unimport3 = require("unimport");
739
739
  var import_fs_extra6 = __toESM(require("fs-extra"), 1);
740
- var import_node_path6 = __toESM(require("path"), 1);
740
+ var import_node_path7 = __toESM(require("path"), 1);
741
741
 
742
742
  // src/core/utils/building/resolve-config.ts
743
743
  var import_c12 = require("c12");
744
- var import_node_path7 = __toESM(require("path"), 1);
744
+ var import_node_path8 = __toESM(require("path"), 1);
745
745
 
746
746
  // src/core/utils/cache.ts
747
747
  var import_fs_extra7 = __toESM(require("fs-extra"), 1);
@@ -750,14 +750,14 @@ function createFsCache(wxtDir) {
750
750
  const getPath = (key) => (0, import_path3.resolve)(wxtDir, "cache", encodeURIComponent(key));
751
751
  return {
752
752
  async set(key, value) {
753
- const path6 = getPath(key);
754
- await (0, import_fs_extra7.ensureDir)((0, import_path3.dirname)(path6));
755
- await writeFileIfDifferent(path6, value);
753
+ const path7 = getPath(key);
754
+ await (0, import_fs_extra7.ensureDir)((0, import_path3.dirname)(path7));
755
+ await writeFileIfDifferent(path7, value);
756
756
  },
757
757
  async get(key) {
758
- const path6 = getPath(key);
758
+ const path7 = getPath(key);
759
759
  try {
760
- return await import_fs_extra7.default.readFile(path6, "utf-8");
760
+ return await import_fs_extra7.default.readFile(path7, "utf-8");
761
761
  } catch {
762
762
  return void 0;
763
763
  }
@@ -808,7 +808,7 @@ async function createViteBuilder(inlineConfig, userConfig, wxtConfig) {
808
808
  defineImportMeta()
809
809
  );
810
810
  if (wxtConfig.analysis.enabled) {
811
- config.plugins.push(bundleAnalysis());
811
+ config.plugins.push(bundleAnalysis(wxtConfig));
812
812
  }
813
813
  return config;
814
814
  };
@@ -1009,20 +1009,20 @@ async function resolveConfig(inlineConfig, command, server) {
1009
1009
  const manifestVersion = mergedConfig.manifestVersion ?? (browser === "firefox" || browser === "safari" ? 2 : 3);
1010
1010
  const mode = mergedConfig.mode ?? (command === "build" ? "production" : "development");
1011
1011
  const env = { browser, command, manifestVersion, mode };
1012
- const root = import_node_path7.default.resolve(
1012
+ const root = import_node_path8.default.resolve(
1013
1013
  inlineConfig.root ?? userConfig.root ?? process.cwd()
1014
1014
  );
1015
- const wxtDir = import_node_path7.default.resolve(root, ".wxt");
1016
- const srcDir = import_node_path7.default.resolve(root, mergedConfig.srcDir ?? root);
1017
- const entrypointsDir = import_node_path7.default.resolve(
1015
+ const wxtDir = import_node_path8.default.resolve(root, ".wxt");
1016
+ const srcDir = import_node_path8.default.resolve(root, mergedConfig.srcDir ?? root);
1017
+ const entrypointsDir = import_node_path8.default.resolve(
1018
1018
  srcDir,
1019
1019
  mergedConfig.entrypointsDir ?? "entrypoints"
1020
1020
  );
1021
1021
  const filterEntrypoints = !!mergedConfig.filterEntrypoints?.length ? new Set(mergedConfig.filterEntrypoints) : void 0;
1022
- const publicDir = import_node_path7.default.resolve(srcDir, mergedConfig.publicDir ?? "public");
1023
- const typesDir = import_node_path7.default.resolve(wxtDir, "types");
1024
- const outBaseDir = import_node_path7.default.resolve(root, mergedConfig.outDir ?? ".output");
1025
- const outDir = import_node_path7.default.resolve(outBaseDir, `${browser}-mv${manifestVersion}`);
1022
+ const publicDir = import_node_path8.default.resolve(srcDir, mergedConfig.publicDir ?? "public");
1023
+ const typesDir = import_node_path8.default.resolve(wxtDir, "types");
1024
+ const outBaseDir = import_node_path8.default.resolve(root, mergedConfig.outDir ?? ".output");
1025
+ const outDir = import_node_path8.default.resolve(outBaseDir, `${browser}-mv${manifestVersion}`);
1026
1026
  const reloadCommand = mergedConfig.dev?.reloadCommand ?? "Alt+R";
1027
1027
  const runnerConfig = await (0, import_c12.loadConfig)({
1028
1028
  name: "web-ext",
@@ -1039,7 +1039,7 @@ async function resolveConfig(inlineConfig, command, server) {
1039
1039
  "~": srcDir,
1040
1040
  "@@": root,
1041
1041
  "~~": root
1042
- }).map(([key, value]) => [key, import_node_path7.default.resolve(root, value)])
1042
+ }).map(([key, value]) => [key, import_node_path8.default.resolve(root, value)])
1043
1043
  );
1044
1044
  const finalConfig = {
1045
1045
  browser,
@@ -1069,7 +1069,11 @@ async function resolveConfig(inlineConfig, command, server) {
1069
1069
  },
1070
1070
  analysis: {
1071
1071
  enabled: mergedConfig.analysis?.enabled ?? false,
1072
- template: mergedConfig.analysis?.template ?? "treemap"
1072
+ template: mergedConfig.analysis?.template ?? "treemap",
1073
+ outputFile: import_node_path8.default.resolve(
1074
+ root,
1075
+ mergedConfig.analysis?.outputFile ?? "stats.html"
1076
+ )
1073
1077
  },
1074
1078
  userConfigMetadata: userConfigMetadata ?? {},
1075
1079
  alias,
@@ -1139,8 +1143,8 @@ function mergeInlineConfig(inlineConfig, userConfig) {
1139
1143
  outDir: inlineConfig.outDir ?? userConfig.outDir,
1140
1144
  zip,
1141
1145
  analysis: {
1142
- enabled: inlineConfig.analysis?.enabled ?? userConfig.analysis?.enabled,
1143
- template: inlineConfig.analysis?.template ?? userConfig.analysis?.template
1146
+ ...userConfig.analysis,
1147
+ ...inlineConfig.analysis
1144
1148
  },
1145
1149
  alias: {
1146
1150
  ...userConfig.alias,
@@ -1186,7 +1190,7 @@ function resolveInternalZipConfig(root, mergedConfig) {
1186
1190
  var import_jiti = __toESM(require("jiti"), 1);
1187
1191
  var import_unimport5 = require("unimport");
1188
1192
  var import_fs_extra8 = __toESM(require("fs-extra"), 1);
1189
- var import_node_path8 = require("path");
1193
+ var import_node_path9 = require("path");
1190
1194
  var import_esbuild = require("esbuild");
1191
1195
  var import_node_url = require("url");
1192
1196
 
@@ -1195,7 +1199,7 @@ var import_picocolors5 = __toESM(require("picocolors"), 1);
1195
1199
  var import_fs_extra12 = __toESM(require("fs-extra"), 1);
1196
1200
 
1197
1201
  // src/core/utils/log/printFileList.ts
1198
- var import_node_path9 = __toESM(require("path"), 1);
1202
+ var import_node_path10 = __toESM(require("path"), 1);
1199
1203
  var import_picocolors3 = __toESM(require("picocolors"), 1);
1200
1204
  var import_fs_extra9 = __toESM(require("fs-extra"), 1);
1201
1205
  var import_filesize = require("filesize");
@@ -1223,20 +1227,19 @@ var import_fast_glob3 = __toESM(require("fast-glob"), 1);
1223
1227
  var import_fs_extra11 = __toESM(require("fs-extra"), 1);
1224
1228
 
1225
1229
  // src/core/utils/package.ts
1226
- var import_node_path10 = require("path");
1230
+ var import_node_path11 = require("path");
1227
1231
  var import_fs_extra10 = __toESM(require("fs-extra"), 1);
1228
1232
 
1229
1233
  // src/core/utils/manifest.ts
1230
- var import_immer = require("immer");
1231
1234
  var import_defu3 = __toESM(require("defu"), 1);
1232
1235
 
1233
1236
  // src/core/utils/building/internal-build.ts
1234
- var import_node_path12 = require("path");
1237
+ var import_node_path13 = require("path");
1235
1238
  var import_consola3 = __toESM(require("consola"), 1);
1236
1239
 
1237
1240
  // src/core/utils/exec.ts
1238
1241
  var import_manage_path = __toESM(require("manage-path"), 1);
1239
- var import_node_path11 = require("path");
1242
+ var import_node_path12 = require("path");
1240
1243
  var managedPath = (0, import_manage_path.default)(process.env);
1241
1244
 
1242
1245
  // src/testing/wxt-vitest-plugin.ts
@@ -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 './index-wltPoSyr.cjs';
3
+ import { I as InlineConfig } from './index-znx-ff-l.cjs';
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 './index-wltPoSyr.js';
3
+ import { I as InlineConfig } from './index-znx-ff-l.js';
4
4
  import 'webextension-polyfill';
5
5
  import 'unimport';
6
6
  import 'consola';
package/dist/testing.js CHANGED
@@ -5,7 +5,7 @@ import {
5
5
  tsconfigPaths,
6
6
  unimport,
7
7
  webextensionPolyfillMock
8
- } from "./chunk-4IVGHIAG.js";
8
+ } from "./chunk-N5MSLHHE.js";
9
9
  import "./chunk-VBXJIVYU.js";
10
10
 
11
11
  // 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.16.3",
4
+ "version": "0.16.5",
5
5
  "description": "Next gen framework for developing web extensions",
6
6
  "engines": {
7
7
  "node": ">=18",
@@ -100,7 +100,6 @@
100
100
  "get-port": "^7.0.0",
101
101
  "giget": "^1.1.3",
102
102
  "hookable": "^5.5.3",
103
- "immer": "^10.0.3",
104
103
  "is-wsl": "^3.0.0",
105
104
  "jiti": "^1.21.0",
106
105
  "json5": "^2.2.3",
@@ -112,7 +111,7 @@
112
111
  "ora": "^7.0.1",
113
112
  "picocolors": "^1.0.0",
114
113
  "prompts": "^2.4.2",
115
- "publish-browser-extension": "^2.1.1",
114
+ "publish-browser-extension": "^2.1.2",
116
115
  "rollup-plugin-visualizer": "^5.9.2",
117
116
  "unimport": "^3.4.0",
118
117
  "vite": "^5.0.12",