wxt 0.16.7 → 0.16.8-alpha2

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,9 +1,5 @@
1
1
  // package.json
2
- var version = "0.16.7";
3
-
4
- // src/core/utils/fs.ts
5
- import fs from "fs-extra";
6
- import glob from "fast-glob";
2
+ var version = "0.16.8-alpha2";
7
3
 
8
4
  // src/core/utils/paths.ts
9
5
  import systemPath from "node:path";
@@ -18,6 +14,8 @@ var CSS_EXTENSIONS = ["css", "scss", "sass", "less", "styl", "stylus"];
18
14
  var CSS_EXTENSIONS_PATTERN = `+(${CSS_EXTENSIONS.join("|")})`;
19
15
 
20
16
  // src/core/utils/fs.ts
17
+ import fs from "fs-extra";
18
+ import glob from "fast-glob";
21
19
  async function writeFileIfDifferent(file, newContents) {
22
20
  const existingContents = await fs.readFile(file, "utf-8").catch(() => void 0);
23
21
  if (existingContents !== newContents) {
@@ -2940,6 +2938,7 @@ async function registerWxt(command, inlineConfig = {}, server) {
2940
2938
  }
2941
2939
 
2942
2940
  export {
2941
+ unnormalizePath,
2943
2942
  wxt,
2944
2943
  registerWxt,
2945
2944
  detectDevChanges,
package/dist/cli.js CHANGED
@@ -2152,7 +2152,7 @@ function getChunkSortWeight(filename) {
2152
2152
  import pc4 from "picocolors";
2153
2153
 
2154
2154
  // package.json
2155
- var version = "0.16.7";
2155
+ var version = "0.16.8-alpha2";
2156
2156
 
2157
2157
  // src/core/utils/log/printHeader.ts
2158
2158
  import { consola as consola2 } from "consola";
@@ -3127,6 +3127,13 @@ async function createServer(inlineConfig) {
3127
3127
  };
3128
3128
  const buildAndOpenBrowser = async () => {
3129
3129
  server.currentOutput = await internalBuild();
3130
+ try {
3131
+ const files = getExternalOutputDependencies(server);
3132
+ console.log("Additional files:", files);
3133
+ server.watcher.add(files);
3134
+ } catch (err) {
3135
+ wxt.config.logger.warn("Failed to register additional file paths:", err);
3136
+ }
3130
3137
  await runner.openBrowser();
3131
3138
  };
3132
3139
  const closeAndRecreateRunner = async () => {
@@ -3300,6 +3307,21 @@ function getFilenameList(names) {
3300
3307
  return pc7.cyan(name);
3301
3308
  }).join(pc7.dim(", "));
3302
3309
  }
3310
+ function getExternalOutputDependencies(server) {
3311
+ const additionalFiles = server.currentOutput?.steps.flatMap((step, i) => {
3312
+ if (Array.isArray(step.entrypoints) && i === 0) {
3313
+ return [];
3314
+ }
3315
+ return step.chunks.flatMap((chunk) => {
3316
+ if (chunk.type === "asset")
3317
+ return [];
3318
+ return chunk.moduleIds;
3319
+ });
3320
+ }).filter(
3321
+ (file) => !file.includes("node_modules") && !file.startsWith("\0")
3322
+ ).map(unnormalizePath).filter((file) => !file.startsWith(wxt.config.root));
3323
+ return additionalFiles ?? [];
3324
+ }
3303
3325
 
3304
3326
  // src/core/initialize.ts
3305
3327
  import prompts from "prompts";
package/dist/index.cjs CHANGED
@@ -4579,7 +4579,7 @@ function getChunkSortWeight(filename) {
4579
4579
  var import_picocolors4 = __toESM(require("picocolors"), 1);
4580
4580
 
4581
4581
  // package.json
4582
- var version = "0.16.7";
4582
+ var version = "0.16.8-alpha2";
4583
4583
 
4584
4584
  // src/core/utils/log/printHeader.ts
4585
4585
  var import_consola2 = require("consola");
@@ -5560,6 +5560,13 @@ async function createServer(inlineConfig) {
5560
5560
  };
5561
5561
  const buildAndOpenBrowser = async () => {
5562
5562
  server.currentOutput = await internalBuild();
5563
+ try {
5564
+ const files = getExternalOutputDependencies(server);
5565
+ console.log("Additional files:", files);
5566
+ server.watcher.add(files);
5567
+ } catch (err) {
5568
+ wxt.config.logger.warn("Failed to register additional file paths:", err);
5569
+ }
5563
5570
  await runner.openBrowser();
5564
5571
  };
5565
5572
  const closeAndRecreateRunner = async () => {
@@ -5733,6 +5740,21 @@ function getFilenameList(names) {
5733
5740
  return import_picocolors7.default.cyan(name);
5734
5741
  }).join(import_picocolors7.default.dim(", "));
5735
5742
  }
5743
+ function getExternalOutputDependencies(server) {
5744
+ const additionalFiles = server.currentOutput?.steps.flatMap((step, i) => {
5745
+ if (Array.isArray(step.entrypoints) && i === 0) {
5746
+ return [];
5747
+ }
5748
+ return step.chunks.flatMap((chunk) => {
5749
+ if (chunk.type === "asset")
5750
+ return [];
5751
+ return chunk.moduleIds;
5752
+ });
5753
+ }).filter(
5754
+ (file) => !file.includes("node_modules") && !file.startsWith("\0")
5755
+ ).map(unnormalizePath).filter((file) => !file.startsWith(wxt.config.root));
5756
+ return additionalFiles ?? [];
5757
+ }
5736
5758
 
5737
5759
  // src/core/initialize.ts
5738
5760
  var import_prompts = __toESM(require("prompts"), 1);
package/dist/index.d.cts CHANGED
@@ -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.7";
67
+ var version = "0.16.8-alpha2";
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
@@ -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.7";
67
+ var version = "0.16.8-alpha2";
68
68
 
69
69
  export { BuildOutput, ExtensionRunnerConfig, InlineConfig, UserConfig, WxtDevServer, build, clean, createServer, defineConfig, defineRunnerConfig, initialize, prepare, version, zip };
package/dist/index.js CHANGED
@@ -13,9 +13,10 @@ import {
13
13
  rebuild,
14
14
  registerWxt,
15
15
  resolvePerBrowserOption,
16
+ unnormalizePath,
16
17
  version,
17
18
  wxt
18
- } from "./chunk-KKL6XTRP.js";
19
+ } from "./chunk-V5L54EDX.js";
19
20
  import "./chunk-VBXJIVYU.js";
20
21
 
21
22
  // src/core/build.ts
@@ -229,6 +230,13 @@ async function createServer(inlineConfig) {
229
230
  };
230
231
  const buildAndOpenBrowser = async () => {
231
232
  server.currentOutput = await internalBuild();
233
+ try {
234
+ const files = getExternalOutputDependencies(server);
235
+ console.log("Additional files:", files);
236
+ server.watcher.add(files);
237
+ } catch (err) {
238
+ wxt.config.logger.warn("Failed to register additional file paths:", err);
239
+ }
232
240
  await runner.openBrowser();
233
241
  };
234
242
  const closeAndRecreateRunner = async () => {
@@ -402,6 +410,21 @@ function getFilenameList(names) {
402
410
  return pc2.cyan(name);
403
411
  }).join(pc2.dim(", "));
404
412
  }
413
+ function getExternalOutputDependencies(server) {
414
+ const additionalFiles = server.currentOutput?.steps.flatMap((step, i) => {
415
+ if (Array.isArray(step.entrypoints) && i === 0) {
416
+ return [];
417
+ }
418
+ return step.chunks.flatMap((chunk) => {
419
+ if (chunk.type === "asset")
420
+ return [];
421
+ return chunk.moduleIds;
422
+ });
423
+ }).filter(
424
+ (file) => !file.includes("node_modules") && !file.startsWith("\0")
425
+ ).map(unnormalizePath).filter((file) => !file.startsWith(wxt.config.root));
426
+ return additionalFiles ?? [];
427
+ }
405
428
 
406
429
  // src/core/initialize.ts
407
430
  import prompts from "prompts";
package/dist/testing.js CHANGED
@@ -5,7 +5,7 @@ import {
5
5
  tsconfigPaths,
6
6
  unimport,
7
7
  webextensionPolyfillMock
8
- } from "./chunk-KKL6XTRP.js";
8
+ } from "./chunk-V5L54EDX.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.7",
4
+ "version": "0.16.8-alpha2",
5
5
  "description": "Next gen framework for developing web extensions",
6
6
  "engines": {
7
7
  "node": ">=18",