wxt 0.16.8-alpha2 → 0.16.9

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.js CHANGED
@@ -9,14 +9,14 @@ import {
9
9
  getPackageJson,
10
10
  internalBuild,
11
11
  kebabCaseAlphanumeric,
12
+ mapWxtOptionsToRegisteredContentScript,
12
13
  printFileList,
13
14
  rebuild,
14
15
  registerWxt,
15
- resolvePerBrowserOption,
16
16
  unnormalizePath,
17
17
  version,
18
18
  wxt
19
- } from "./chunk-V5L54EDX.js";
19
+ } from "./chunk-CKAPFUPR.js";
20
20
  import "./chunk-VBXJIVYU.js";
21
21
 
22
22
  // src/core/build.ts
@@ -231,9 +231,7 @@ async function createServer(inlineConfig) {
231
231
  const buildAndOpenBrowser = async () => {
232
232
  server.currentOutput = await internalBuild();
233
233
  try {
234
- const files = getExternalOutputDependencies(server);
235
- console.log("Additional files:", files);
236
- server.watcher.add(files);
234
+ server.watcher.add(getExternalOutputDependencies(server));
237
235
  } catch (err) {
238
236
  wxt.config.logger.warn("Failed to register additional file paths:", err);
239
237
  }
@@ -371,25 +369,9 @@ function reloadContentScripts(steps, server) {
371
369
  const js = [getEntrypointBundlePath(entry, wxt.config.outDir, ".js")];
372
370
  const cssMap = getContentScriptsCssMap(server.currentOutput, [entry]);
373
371
  const css = getContentScriptCssFiles([entry], cssMap);
374
- server.reloadContentScript({
375
- allFrames: resolvePerBrowserOption(
376
- entry.options.allFrames,
377
- wxt.config.browser
378
- ),
379
- excludeMatches: resolvePerBrowserOption(
380
- entry.options.excludeMatches,
381
- wxt.config.browser
382
- ),
383
- matches: resolvePerBrowserOption(
384
- entry.options.matches,
385
- wxt.config.browser
386
- ),
387
- runAt: resolvePerBrowserOption(entry.options.runAt, wxt.config.browser),
388
- // @ts-expect-error: Chrome accepts this, not typed in webextension-polyfill (https://developer.chrome.com/docs/extensions/reference/scripting/#type-RegisteredContentScript)
389
- world: resolvePerBrowserOption(entry.options.world, wxt.config.browser),
390
- js,
391
- css
392
- });
372
+ server.reloadContentScript(
373
+ mapWxtOptionsToRegisteredContentScript(entry.options, js, css)
374
+ );
393
375
  });
394
376
  } else {
395
377
  server.reloadExtension();
@@ -411,7 +393,7 @@ function getFilenameList(names) {
411
393
  }).join(pc2.dim(", "));
412
394
  }
413
395
  function getExternalOutputDependencies(server) {
414
- const additionalFiles = server.currentOutput?.steps.flatMap((step, i) => {
396
+ return server.currentOutput?.steps.flatMap((step, i) => {
415
397
  if (Array.isArray(step.entrypoints) && i === 0) {
416
398
  return [];
417
399
  }
@@ -422,8 +404,7 @@ function getExternalOutputDependencies(server) {
422
404
  });
423
405
  }).filter(
424
406
  (file) => !file.includes("node_modules") && !file.startsWith("\0")
425
- ).map(unnormalizePath).filter((file) => !file.startsWith(wxt.config.root));
426
- return additionalFiles ?? [];
407
+ ).map(unnormalizePath).filter((file) => !file.startsWith(wxt.config.root)) ?? [];
427
408
  }
428
409
 
429
410
  // src/core/initialize.ts
package/dist/sandbox.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { U as UnlistedScriptDefinition, B as BackgroundDefinition, C as ContentScriptDefinition } from './index-TYmXqKVq.js';
1
+ import { U as UnlistedScriptDefinition, B as BackgroundDefinition, C as ContentScriptDefinition } from './index-nSEE-7AX.js';
2
2
  export * from '@webext-core/match-patterns';
3
3
  import 'webextension-polyfill';
4
4
 
@@ -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-sl22zA2Z.cjs';
3
+ import { I as InlineConfig } from './index-GDr2OfIq.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-sl22zA2Z.js';
3
+ import { I as InlineConfig } from './index-GDr2OfIq.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-V5L54EDX.js";
8
+ } from "./chunk-CKAPFUPR.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.8-alpha2",
4
+ "version": "0.16.9",
5
5
  "description": "Next gen framework for developing web extensions",
6
6
  "engines": {
7
7
  "node": ">=18",