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/{chunk-V5L54EDX.js → chunk-CKAPFUPR.js} +151 -135
- package/dist/cli.js +156 -159
- package/dist/client.d.ts +1 -1
- package/dist/client.js +2 -2
- package/dist/{index-sl22zA2Z.d.cts → index-GDr2OfIq.d.cts} +151 -107
- package/dist/{index-sl22zA2Z.d.ts → index-GDr2OfIq.d.ts} +151 -107
- package/dist/{index-TYmXqKVq.d.ts → index-nSEE-7AX.d.ts} +57 -36
- package/dist/index.cjs +156 -159
- package/dist/index.d.cts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +8 -27
- package/dist/sandbox.d.ts +1 -1
- package/dist/testing.d.cts +1 -1
- package/dist/testing.d.ts +1 -1
- package/dist/testing.js +1 -1
- package/package.json +1 -1
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-
|
|
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
|
-
|
|
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
|
-
|
|
376
|
-
|
|
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
|
-
|
|
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-
|
|
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
|
|
package/dist/testing.d.cts
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-
|
|
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-
|
|
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