wxt 0.17.10 → 0.17.11
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-5X3S6AWF.js +22 -0
- package/dist/{chunk-2SH4GQGN.js → chunk-XFXYT75Z.js} +61 -45
- package/dist/cli.js +80 -48
- package/dist/{index-w7ohFTEX.d.cts → index-2A45qoLY.d.cts} +2 -3
- package/dist/{index-w7ohFTEX.d.ts → index-2A45qoLY.d.ts} +2 -3
- package/dist/index.cjs +75 -46
- package/dist/index.d.cts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +4 -2
- package/dist/storage.cjs +6 -1
- package/dist/storage.js +4 -1
- package/dist/testing.cjs +17 -1
- package/dist/testing.d.cts +1 -1
- package/dist/testing.d.ts +1 -1
- package/dist/testing.js +2 -1
- package/dist/virtual/background-entrypoint.js +1 -1
- package/dist/virtual/content-script-isolated-world-entrypoint.js +1 -1
- package/dist/virtual/content-script-main-world-entrypoint.js +1 -1
- package/dist/virtual/unlisted-script-entrypoint.js +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
// src/core/utils/arrays.ts
|
|
2
|
+
function every(array, predicate) {
|
|
3
|
+
for (let i = 0; i < array.length; i++)
|
|
4
|
+
if (!predicate(array[i], i))
|
|
5
|
+
return false;
|
|
6
|
+
return true;
|
|
7
|
+
}
|
|
8
|
+
function some(array, predicate) {
|
|
9
|
+
for (let i = 0; i < array.length; i++)
|
|
10
|
+
if (predicate(array[i], i))
|
|
11
|
+
return true;
|
|
12
|
+
return false;
|
|
13
|
+
}
|
|
14
|
+
function toArray(a) {
|
|
15
|
+
return Array.isArray(a) ? a : [a];
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export {
|
|
19
|
+
every,
|
|
20
|
+
some,
|
|
21
|
+
toArray
|
|
22
|
+
};
|
|
@@ -1,9 +1,14 @@
|
|
|
1
|
+
import {
|
|
2
|
+
every,
|
|
3
|
+
some,
|
|
4
|
+
toArray
|
|
5
|
+
} from "./chunk-5X3S6AWF.js";
|
|
1
6
|
import {
|
|
2
7
|
__require
|
|
3
8
|
} from "./chunk-VBXJIVYU.js";
|
|
4
9
|
|
|
5
10
|
// package.json
|
|
6
|
-
var version = "0.17.
|
|
11
|
+
var version = "0.17.11";
|
|
7
12
|
|
|
8
13
|
// src/core/utils/paths.ts
|
|
9
14
|
import systemPath from "node:path";
|
|
@@ -488,32 +493,50 @@ async function removeEmptyDirs(dir) {
|
|
|
488
493
|
}
|
|
489
494
|
}
|
|
490
495
|
|
|
491
|
-
// src/core/
|
|
496
|
+
// src/core/utils/virtual-modules.ts
|
|
497
|
+
var virtualEntrypointTypes = [
|
|
498
|
+
"content-script-main-world",
|
|
499
|
+
"content-script-isolated-world",
|
|
500
|
+
"background",
|
|
501
|
+
"unlisted-script"
|
|
502
|
+
];
|
|
503
|
+
var virtualEntrypointModuleNames = virtualEntrypointTypes.map(
|
|
504
|
+
(name) => `${name}-entrypoint`
|
|
505
|
+
);
|
|
506
|
+
var virtualModuleNames = [
|
|
507
|
+
...virtualEntrypointModuleNames,
|
|
508
|
+
"mock-browser",
|
|
509
|
+
"reload-html"
|
|
510
|
+
];
|
|
511
|
+
|
|
512
|
+
// src/core/builders/vite/plugins/resolveVirtualModules.ts
|
|
492
513
|
import fs2 from "fs-extra";
|
|
493
514
|
import { resolve as resolve4 } from "path";
|
|
494
|
-
function
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
515
|
+
function resolveVirtualModules(config) {
|
|
516
|
+
return virtualModuleNames.map((name) => {
|
|
517
|
+
const virtualId = `virtual:wxt-${name}?`;
|
|
518
|
+
const resolvedVirtualId = "\0" + virtualId;
|
|
519
|
+
return {
|
|
520
|
+
name: `wxt:resolve-virtual-${name}`,
|
|
521
|
+
resolveId(id) {
|
|
522
|
+
const index = id.indexOf(virtualId);
|
|
523
|
+
if (index === -1)
|
|
524
|
+
return;
|
|
525
|
+
const inputPath = normalizePath(id.substring(index + virtualId.length));
|
|
526
|
+
return resolvedVirtualId + inputPath;
|
|
527
|
+
},
|
|
528
|
+
async load(id) {
|
|
529
|
+
if (!id.startsWith(resolvedVirtualId))
|
|
530
|
+
return;
|
|
531
|
+
const inputPath = id.replace(resolvedVirtualId, "");
|
|
532
|
+
const template = await fs2.readFile(
|
|
533
|
+
resolve4(config.wxtModuleDir, `dist/virtual/${name}.js`),
|
|
534
|
+
"utf-8"
|
|
535
|
+
);
|
|
536
|
+
return template.replace(`virtual:user-${name}`, inputPath);
|
|
537
|
+
}
|
|
538
|
+
};
|
|
539
|
+
});
|
|
517
540
|
}
|
|
518
541
|
|
|
519
542
|
// src/core/utils/constants.ts
|
|
@@ -656,7 +679,7 @@ async function buildEntrypoints(groups, spinner) {
|
|
|
656
679
|
const steps = [];
|
|
657
680
|
for (let i = 0; i < groups.length; i++) {
|
|
658
681
|
const group = groups[i];
|
|
659
|
-
const groupNames =
|
|
682
|
+
const groupNames = toArray(group).map((e) => e.name);
|
|
660
683
|
const groupNameColored = groupNames.join(pc.dim(", "));
|
|
661
684
|
spinner.text = pc.dim(`[${i + 1}/${groups.length}]`) + ` ${groupNameColored}`;
|
|
662
685
|
try {
|
|
@@ -688,20 +711,6 @@ async function copyPublicDirectory() {
|
|
|
688
711
|
return publicAssets;
|
|
689
712
|
}
|
|
690
713
|
|
|
691
|
-
// src/core/utils/arrays.ts
|
|
692
|
-
function every(array, predicate) {
|
|
693
|
-
for (let i = 0; i < array.length; i++)
|
|
694
|
-
if (!predicate(array[i], i))
|
|
695
|
-
return false;
|
|
696
|
-
return true;
|
|
697
|
-
}
|
|
698
|
-
function some(array, predicate) {
|
|
699
|
-
for (let i = 0; i < array.length; i++)
|
|
700
|
-
if (predicate(array[i], i))
|
|
701
|
-
return true;
|
|
702
|
-
return false;
|
|
703
|
-
}
|
|
704
|
-
|
|
705
714
|
// src/core/utils/building/detect-dev-changes.ts
|
|
706
715
|
function detectDevChanges(changedFiles, currentOutput) {
|
|
707
716
|
const isConfigChange = some(
|
|
@@ -2069,6 +2078,9 @@ function mapWxtOptionsToRegisteredContentScript(options, js, css) {
|
|
|
2069
2078
|
world: options.world
|
|
2070
2079
|
};
|
|
2071
2080
|
}
|
|
2081
|
+
function getContentScriptJs(config, entrypoint) {
|
|
2082
|
+
return [getEntrypointBundlePath(entrypoint, config.outDir, ".js")];
|
|
2083
|
+
}
|
|
2072
2084
|
|
|
2073
2085
|
// src/core/utils/manifest.ts
|
|
2074
2086
|
import defu2 from "defu";
|
|
@@ -2991,6 +3003,8 @@ async function createViteBuilder(wxtConfig, server) {
|
|
|
2991
3003
|
config.logLevel = "warn";
|
|
2992
3004
|
config.mode = wxtConfig.mode;
|
|
2993
3005
|
config.build ??= {};
|
|
3006
|
+
config.publicDir = wxtConfig.publicDir;
|
|
3007
|
+
config.build.copyPublicDir = false;
|
|
2994
3008
|
config.build.outDir = wxtConfig.outDir;
|
|
2995
3009
|
config.build.emptyOutDir = false;
|
|
2996
3010
|
if (config.build.minify == null && wxtConfig.command === "serve") {
|
|
@@ -3004,10 +3018,7 @@ async function createViteBuilder(wxtConfig, server) {
|
|
|
3004
3018
|
download(wxtConfig),
|
|
3005
3019
|
devHtmlPrerender(wxtConfig, server),
|
|
3006
3020
|
unimport(wxtConfig),
|
|
3007
|
-
|
|
3008
|
-
virtualEntrypoint("content-script-isolated-world", wxtConfig),
|
|
3009
|
-
virtualEntrypoint("content-script-main-world", wxtConfig),
|
|
3010
|
-
virtualEntrypoint("unlisted-script", wxtConfig),
|
|
3021
|
+
resolveVirtualModules(wxtConfig),
|
|
3011
3022
|
devServerGlobals(wxtConfig, server),
|
|
3012
3023
|
tsconfigPaths(wxtConfig),
|
|
3013
3024
|
noopBackground(),
|
|
@@ -3192,7 +3203,11 @@ function getRollupEntry(entrypoint) {
|
|
|
3192
3203
|
virtualEntrypointType = entrypoint.options.world === "MAIN" ? "content-script-main-world" : "content-script-isolated-world";
|
|
3193
3204
|
break;
|
|
3194
3205
|
}
|
|
3195
|
-
|
|
3206
|
+
if (virtualEntrypointType) {
|
|
3207
|
+
const moduleId = `virtual:wxt-${virtualEntrypointType}-entrypoint`;
|
|
3208
|
+
return `${moduleId}?${entrypoint.inputPath}`;
|
|
3209
|
+
}
|
|
3210
|
+
return entrypoint.inputPath;
|
|
3196
3211
|
}
|
|
3197
3212
|
|
|
3198
3213
|
// src/core/wxt.ts
|
|
@@ -3242,6 +3257,7 @@ export {
|
|
|
3242
3257
|
printFileList,
|
|
3243
3258
|
version,
|
|
3244
3259
|
mapWxtOptionsToRegisteredContentScript,
|
|
3260
|
+
getContentScriptJs,
|
|
3245
3261
|
getContentScriptCssFiles,
|
|
3246
3262
|
getContentScriptsCssMap,
|
|
3247
3263
|
rebuild,
|
package/dist/cli.js
CHANGED
|
@@ -593,32 +593,50 @@ function unimport(config) {
|
|
|
593
593
|
};
|
|
594
594
|
}
|
|
595
595
|
|
|
596
|
-
// src/core/
|
|
596
|
+
// src/core/utils/virtual-modules.ts
|
|
597
|
+
var virtualEntrypointTypes = [
|
|
598
|
+
"content-script-main-world",
|
|
599
|
+
"content-script-isolated-world",
|
|
600
|
+
"background",
|
|
601
|
+
"unlisted-script"
|
|
602
|
+
];
|
|
603
|
+
var virtualEntrypointModuleNames = virtualEntrypointTypes.map(
|
|
604
|
+
(name) => `${name}-entrypoint`
|
|
605
|
+
);
|
|
606
|
+
var virtualModuleNames = [
|
|
607
|
+
...virtualEntrypointModuleNames,
|
|
608
|
+
"mock-browser",
|
|
609
|
+
"reload-html"
|
|
610
|
+
];
|
|
611
|
+
|
|
612
|
+
// src/core/builders/vite/plugins/resolveVirtualModules.ts
|
|
597
613
|
import fs2 from "fs-extra";
|
|
598
614
|
import { resolve as resolve4 } from "path";
|
|
599
|
-
function
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
615
|
+
function resolveVirtualModules(config) {
|
|
616
|
+
return virtualModuleNames.map((name) => {
|
|
617
|
+
const virtualId = `virtual:wxt-${name}?`;
|
|
618
|
+
const resolvedVirtualId = "\0" + virtualId;
|
|
619
|
+
return {
|
|
620
|
+
name: `wxt:resolve-virtual-${name}`,
|
|
621
|
+
resolveId(id) {
|
|
622
|
+
const index = id.indexOf(virtualId);
|
|
623
|
+
if (index === -1)
|
|
624
|
+
return;
|
|
625
|
+
const inputPath = normalizePath(id.substring(index + virtualId.length));
|
|
626
|
+
return resolvedVirtualId + inputPath;
|
|
627
|
+
},
|
|
628
|
+
async load(id) {
|
|
629
|
+
if (!id.startsWith(resolvedVirtualId))
|
|
630
|
+
return;
|
|
631
|
+
const inputPath = id.replace(resolvedVirtualId, "");
|
|
632
|
+
const template = await fs2.readFile(
|
|
633
|
+
resolve4(config.wxtModuleDir, `dist/virtual/${name}.js`),
|
|
634
|
+
"utf-8"
|
|
635
|
+
);
|
|
636
|
+
return template.replace(`virtual:user-${name}`, inputPath);
|
|
637
|
+
}
|
|
638
|
+
};
|
|
639
|
+
});
|
|
622
640
|
}
|
|
623
641
|
|
|
624
642
|
// src/core/builders/vite/plugins/tsconfigPaths.ts
|
|
@@ -832,6 +850,8 @@ async function createViteBuilder(wxtConfig, server) {
|
|
|
832
850
|
config.logLevel = "warn";
|
|
833
851
|
config.mode = wxtConfig.mode;
|
|
834
852
|
config.build ??= {};
|
|
853
|
+
config.publicDir = wxtConfig.publicDir;
|
|
854
|
+
config.build.copyPublicDir = false;
|
|
835
855
|
config.build.outDir = wxtConfig.outDir;
|
|
836
856
|
config.build.emptyOutDir = false;
|
|
837
857
|
if (config.build.minify == null && wxtConfig.command === "serve") {
|
|
@@ -845,10 +865,7 @@ async function createViteBuilder(wxtConfig, server) {
|
|
|
845
865
|
download(wxtConfig),
|
|
846
866
|
devHtmlPrerender(wxtConfig, server),
|
|
847
867
|
unimport(wxtConfig),
|
|
848
|
-
|
|
849
|
-
virtualEntrypoint("content-script-isolated-world", wxtConfig),
|
|
850
|
-
virtualEntrypoint("content-script-main-world", wxtConfig),
|
|
851
|
-
virtualEntrypoint("unlisted-script", wxtConfig),
|
|
868
|
+
resolveVirtualModules(wxtConfig),
|
|
852
869
|
devServerGlobals(wxtConfig, server),
|
|
853
870
|
tsconfigPaths(wxtConfig),
|
|
854
871
|
noopBackground(),
|
|
@@ -1033,7 +1050,11 @@ function getRollupEntry(entrypoint) {
|
|
|
1033
1050
|
virtualEntrypointType = entrypoint.options.world === "MAIN" ? "content-script-main-world" : "content-script-isolated-world";
|
|
1034
1051
|
break;
|
|
1035
1052
|
}
|
|
1036
|
-
|
|
1053
|
+
if (virtualEntrypointType) {
|
|
1054
|
+
const moduleId = `virtual:wxt-${virtualEntrypointType}-entrypoint`;
|
|
1055
|
+
return `${moduleId}?${entrypoint.inputPath}`;
|
|
1056
|
+
}
|
|
1057
|
+
return entrypoint.inputPath;
|
|
1037
1058
|
}
|
|
1038
1059
|
|
|
1039
1060
|
// src/core/wxt.ts
|
|
@@ -1079,11 +1100,33 @@ async function getPublicFiles() {
|
|
|
1079
1100
|
import fs4 from "fs-extra";
|
|
1080
1101
|
import { dirname as dirname3, resolve as resolve5 } from "path";
|
|
1081
1102
|
import pc from "picocolors";
|
|
1103
|
+
|
|
1104
|
+
// src/core/utils/arrays.ts
|
|
1105
|
+
function every(array, predicate) {
|
|
1106
|
+
for (let i = 0; i < array.length; i++)
|
|
1107
|
+
if (!predicate(array[i], i))
|
|
1108
|
+
return false;
|
|
1109
|
+
return true;
|
|
1110
|
+
}
|
|
1111
|
+
function some(array, predicate) {
|
|
1112
|
+
for (let i = 0; i < array.length; i++)
|
|
1113
|
+
if (predicate(array[i], i))
|
|
1114
|
+
return true;
|
|
1115
|
+
return false;
|
|
1116
|
+
}
|
|
1117
|
+
function toArray(a) {
|
|
1118
|
+
return Array.isArray(a) ? a : [a];
|
|
1119
|
+
}
|
|
1120
|
+
function filterTruthy(array) {
|
|
1121
|
+
return array.filter((item) => !!item);
|
|
1122
|
+
}
|
|
1123
|
+
|
|
1124
|
+
// src/core/utils/building/build-entrypoints.ts
|
|
1082
1125
|
async function buildEntrypoints(groups, spinner) {
|
|
1083
1126
|
const steps = [];
|
|
1084
1127
|
for (let i = 0; i < groups.length; i++) {
|
|
1085
1128
|
const group = groups[i];
|
|
1086
|
-
const groupNames =
|
|
1129
|
+
const groupNames = toArray(group).map((e) => e.name);
|
|
1087
1130
|
const groupNameColored = groupNames.join(pc.dim(", "));
|
|
1088
1131
|
spinner.text = pc.dim(`[${i + 1}/${groups.length}]`) + ` ${groupNameColored}`;
|
|
1089
1132
|
try {
|
|
@@ -1115,20 +1158,6 @@ async function copyPublicDirectory() {
|
|
|
1115
1158
|
return publicAssets;
|
|
1116
1159
|
}
|
|
1117
1160
|
|
|
1118
|
-
// src/core/utils/arrays.ts
|
|
1119
|
-
function every(array, predicate) {
|
|
1120
|
-
for (let i = 0; i < array.length; i++)
|
|
1121
|
-
if (!predicate(array[i], i))
|
|
1122
|
-
return false;
|
|
1123
|
-
return true;
|
|
1124
|
-
}
|
|
1125
|
-
function some(array, predicate) {
|
|
1126
|
-
for (let i = 0; i < array.length; i++)
|
|
1127
|
-
if (predicate(array[i], i))
|
|
1128
|
-
return true;
|
|
1129
|
-
return false;
|
|
1130
|
-
}
|
|
1131
|
-
|
|
1132
1161
|
// src/core/utils/building/detect-dev-changes.ts
|
|
1133
1162
|
function detectDevChanges(changedFiles, currentOutput) {
|
|
1134
1163
|
const isConfigChange = some(
|
|
@@ -2386,7 +2415,7 @@ function getChunkSortWeight(filename) {
|
|
|
2386
2415
|
import pc4 from "picocolors";
|
|
2387
2416
|
|
|
2388
2417
|
// package.json
|
|
2389
|
-
var version = "0.17.
|
|
2418
|
+
var version = "0.17.11";
|
|
2390
2419
|
|
|
2391
2420
|
// src/core/utils/log/printHeader.ts
|
|
2392
2421
|
import { consola as consola2 } from "consola";
|
|
@@ -2505,6 +2534,9 @@ function mapWxtOptionsToRegisteredContentScript(options, js, css) {
|
|
|
2505
2534
|
world: options.world
|
|
2506
2535
|
};
|
|
2507
2536
|
}
|
|
2537
|
+
function getContentScriptJs(config, entrypoint) {
|
|
2538
|
+
return [getEntrypointBundlePath(entrypoint, config.outDir, ".js")];
|
|
2539
|
+
}
|
|
2508
2540
|
|
|
2509
2541
|
// src/core/utils/manifest.ts
|
|
2510
2542
|
import defu2 from "defu";
|
|
@@ -3546,7 +3578,7 @@ function reloadContentScripts(steps, server) {
|
|
|
3546
3578
|
const entry = step.entrypoints;
|
|
3547
3579
|
if (Array.isArray(entry) || entry.type !== "content-script")
|
|
3548
3580
|
return;
|
|
3549
|
-
const js =
|
|
3581
|
+
const js = getContentScriptJs(wxt.config, entry);
|
|
3550
3582
|
const cssMap = getContentScriptsCssMap(server.currentOutput, [entry]);
|
|
3551
3583
|
const css = getContentScriptCssFiles([entry], cssMap);
|
|
3552
3584
|
server.reloadContentScript({
|
|
@@ -3889,8 +3921,8 @@ function wrapAction(cb, options) {
|
|
|
3889
3921
|
};
|
|
3890
3922
|
}
|
|
3891
3923
|
function getArrayFromFlags(flags, name) {
|
|
3892
|
-
const array =
|
|
3893
|
-
const result = array
|
|
3924
|
+
const array = toArray(flags[name]);
|
|
3925
|
+
const result = filterTruthy(array);
|
|
3894
3926
|
return result.length ? result : void 0;
|
|
3895
3927
|
}
|
|
3896
3928
|
var aliasCommandNames = /* @__PURE__ */ new Set();
|
|
@@ -291,7 +291,7 @@ interface InlineConfig {
|
|
|
291
291
|
*
|
|
292
292
|
* @example
|
|
293
293
|
* [
|
|
294
|
-
* "coverage", //
|
|
294
|
+
* "coverage", // Include the coverage directory in the `sourcesRoot`
|
|
295
295
|
* ]
|
|
296
296
|
*/
|
|
297
297
|
excludeSources?: string[];
|
|
@@ -1110,7 +1110,6 @@ interface ExtensionRunner {
|
|
|
1110
1110
|
openBrowser(): Promise<void>;
|
|
1111
1111
|
closeBrowser(): Promise<void>;
|
|
1112
1112
|
}
|
|
1113
|
-
type VirtualEntrypointType = 'content-script-main-world' | 'content-script-isolated-world' | 'background' | 'unlisted-script';
|
|
1114
1113
|
type EslintGlobalsPropValue = boolean | 'readonly' | 'readable' | 'writable' | 'writeable';
|
|
1115
1114
|
interface Eslintrc {
|
|
1116
1115
|
/**
|
|
@@ -1186,4 +1185,4 @@ interface Dependency {
|
|
|
1186
1185
|
version: string;
|
|
1187
1186
|
}
|
|
1188
1187
|
|
|
1189
|
-
export type {
|
|
1188
|
+
export type { EslintGlobalsPropValue as $, ResolvedPerBrowserOptions as A, BuildOutput as B, ContentScriptEntrypoint as C, UserManifest as D, ExtensionRunnerConfig as E, UserManifestFn as F, GenericEntrypoint as G, ConfigEnv as H, InlineConfig as I, WxtCommand as J, WxtBuilder as K, Logger as L, MainWorldContentScriptEntrypointOptions as M, WxtBuilderServer as N, OutputFile as O, PopupEntrypointOptions as P, ServerInfo as Q, ResolvedConfig as R, SidepanelEntrypointOptions as S, TargetBrowser as T, UserConfig as U, HookResult as V, WxtDevServer as W, WxtHooks as X, Wxt as Y, FsCache as Z, ExtensionRunner as _, WxtViteConfig as a, Eslintrc as a0, ResolvedEslintrc as a1, WxtUnimportOptions as a2, WxtResolvedUnimportOptions as a3, WxtPackageManager as a4, Dependency as a5, OutputChunk as b, OutputAsset as c, BuildStepOutput as d, ReloadContentScriptPayload as e, TargetManifestVersion as f, BaseEntrypointOptions as g, BackgroundEntrypointOptions as h, BaseContentScriptEntrypointOptions as i, IsolatedWorldContentScriptEntrypointOptions as j, OptionsEntrypointOptions as k, BaseEntrypoint as l, BackgroundEntrypoint as m, PopupEntrypoint as n, OptionsEntrypoint as o, SidepanelEntrypoint as p, Entrypoint as q, EntrypointGroup as r, OnContentScriptStopped as s, IsolatedWorldContentScriptDefinition as t, MainWorldContentScriptDefinition as u, ContentScriptDefinition as v, BackgroundDefinition as w, UnlistedScriptDefinition as x, PerBrowserOption as y, PerBrowserMap as z };
|
|
@@ -291,7 +291,7 @@ interface InlineConfig {
|
|
|
291
291
|
*
|
|
292
292
|
* @example
|
|
293
293
|
* [
|
|
294
|
-
* "coverage", //
|
|
294
|
+
* "coverage", // Include the coverage directory in the `sourcesRoot`
|
|
295
295
|
* ]
|
|
296
296
|
*/
|
|
297
297
|
excludeSources?: string[];
|
|
@@ -1110,7 +1110,6 @@ interface ExtensionRunner {
|
|
|
1110
1110
|
openBrowser(): Promise<void>;
|
|
1111
1111
|
closeBrowser(): Promise<void>;
|
|
1112
1112
|
}
|
|
1113
|
-
type VirtualEntrypointType = 'content-script-main-world' | 'content-script-isolated-world' | 'background' | 'unlisted-script';
|
|
1114
1113
|
type EslintGlobalsPropValue = boolean | 'readonly' | 'readable' | 'writable' | 'writeable';
|
|
1115
1114
|
interface Eslintrc {
|
|
1116
1115
|
/**
|
|
@@ -1186,4 +1185,4 @@ interface Dependency {
|
|
|
1186
1185
|
version: string;
|
|
1187
1186
|
}
|
|
1188
1187
|
|
|
1189
|
-
export type {
|
|
1188
|
+
export type { EslintGlobalsPropValue as $, ResolvedPerBrowserOptions as A, BuildOutput as B, ContentScriptEntrypoint as C, UserManifest as D, ExtensionRunnerConfig as E, UserManifestFn as F, GenericEntrypoint as G, ConfigEnv as H, InlineConfig as I, WxtCommand as J, WxtBuilder as K, Logger as L, MainWorldContentScriptEntrypointOptions as M, WxtBuilderServer as N, OutputFile as O, PopupEntrypointOptions as P, ServerInfo as Q, ResolvedConfig as R, SidepanelEntrypointOptions as S, TargetBrowser as T, UserConfig as U, HookResult as V, WxtDevServer as W, WxtHooks as X, Wxt as Y, FsCache as Z, ExtensionRunner as _, WxtViteConfig as a, Eslintrc as a0, ResolvedEslintrc as a1, WxtUnimportOptions as a2, WxtResolvedUnimportOptions as a3, WxtPackageManager as a4, Dependency as a5, OutputChunk as b, OutputAsset as c, BuildStepOutput as d, ReloadContentScriptPayload as e, TargetManifestVersion as f, BaseEntrypointOptions as g, BackgroundEntrypointOptions as h, BaseContentScriptEntrypointOptions as i, IsolatedWorldContentScriptEntrypointOptions as j, OptionsEntrypointOptions as k, BaseEntrypoint as l, BackgroundEntrypoint as m, PopupEntrypoint as n, OptionsEntrypoint as o, SidepanelEntrypoint as p, Entrypoint as q, EntrypointGroup as r, OnContentScriptStopped as s, IsolatedWorldContentScriptDefinition as t, MainWorldContentScriptDefinition as u, ContentScriptDefinition as v, BackgroundDefinition as w, UnlistedScriptDefinition as x, PerBrowserOption as y, PerBrowserMap as z };
|
package/dist/index.cjs
CHANGED
|
@@ -3007,32 +3007,50 @@ function unimport(config) {
|
|
|
3007
3007
|
};
|
|
3008
3008
|
}
|
|
3009
3009
|
|
|
3010
|
-
// src/core/
|
|
3010
|
+
// src/core/utils/virtual-modules.ts
|
|
3011
|
+
var virtualEntrypointTypes = [
|
|
3012
|
+
"content-script-main-world",
|
|
3013
|
+
"content-script-isolated-world",
|
|
3014
|
+
"background",
|
|
3015
|
+
"unlisted-script"
|
|
3016
|
+
];
|
|
3017
|
+
var virtualEntrypointModuleNames = virtualEntrypointTypes.map(
|
|
3018
|
+
(name) => `${name}-entrypoint`
|
|
3019
|
+
);
|
|
3020
|
+
var virtualModuleNames = [
|
|
3021
|
+
...virtualEntrypointModuleNames,
|
|
3022
|
+
"mock-browser",
|
|
3023
|
+
"reload-html"
|
|
3024
|
+
];
|
|
3025
|
+
|
|
3026
|
+
// src/core/builders/vite/plugins/resolveVirtualModules.ts
|
|
3011
3027
|
var import_fs_extra3 = __toESM(require("fs-extra"), 1);
|
|
3012
3028
|
var import_path2 = require("path");
|
|
3013
|
-
function
|
|
3014
|
-
|
|
3015
|
-
|
|
3016
|
-
|
|
3017
|
-
|
|
3018
|
-
|
|
3019
|
-
|
|
3020
|
-
|
|
3021
|
-
|
|
3022
|
-
|
|
3023
|
-
|
|
3024
|
-
|
|
3025
|
-
|
|
3026
|
-
|
|
3027
|
-
|
|
3028
|
-
|
|
3029
|
-
|
|
3030
|
-
|
|
3031
|
-
|
|
3032
|
-
|
|
3033
|
-
|
|
3034
|
-
|
|
3035
|
-
|
|
3029
|
+
function resolveVirtualModules(config) {
|
|
3030
|
+
return virtualModuleNames.map((name) => {
|
|
3031
|
+
const virtualId = `virtual:wxt-${name}?`;
|
|
3032
|
+
const resolvedVirtualId = "\0" + virtualId;
|
|
3033
|
+
return {
|
|
3034
|
+
name: `wxt:resolve-virtual-${name}`,
|
|
3035
|
+
resolveId(id) {
|
|
3036
|
+
const index = id.indexOf(virtualId);
|
|
3037
|
+
if (index === -1)
|
|
3038
|
+
return;
|
|
3039
|
+
const inputPath = normalizePath(id.substring(index + virtualId.length));
|
|
3040
|
+
return resolvedVirtualId + inputPath;
|
|
3041
|
+
},
|
|
3042
|
+
async load(id) {
|
|
3043
|
+
if (!id.startsWith(resolvedVirtualId))
|
|
3044
|
+
return;
|
|
3045
|
+
const inputPath = id.replace(resolvedVirtualId, "");
|
|
3046
|
+
const template = await import_fs_extra3.default.readFile(
|
|
3047
|
+
(0, import_path2.resolve)(config.wxtModuleDir, `dist/virtual/${name}.js`),
|
|
3048
|
+
"utf-8"
|
|
3049
|
+
);
|
|
3050
|
+
return template.replace(`virtual:user-${name}`, inputPath);
|
|
3051
|
+
}
|
|
3052
|
+
};
|
|
3053
|
+
});
|
|
3036
3054
|
}
|
|
3037
3055
|
|
|
3038
3056
|
// src/core/builders/vite/plugins/tsconfigPaths.ts
|
|
@@ -3249,6 +3267,8 @@ async function createViteBuilder(wxtConfig, server) {
|
|
|
3249
3267
|
config.logLevel = "warn";
|
|
3250
3268
|
config.mode = wxtConfig.mode;
|
|
3251
3269
|
config.build ??= {};
|
|
3270
|
+
config.publicDir = wxtConfig.publicDir;
|
|
3271
|
+
config.build.copyPublicDir = false;
|
|
3252
3272
|
config.build.outDir = wxtConfig.outDir;
|
|
3253
3273
|
config.build.emptyOutDir = false;
|
|
3254
3274
|
if (config.build.minify == null && wxtConfig.command === "serve") {
|
|
@@ -3262,10 +3282,7 @@ async function createViteBuilder(wxtConfig, server) {
|
|
|
3262
3282
|
download(wxtConfig),
|
|
3263
3283
|
devHtmlPrerender(wxtConfig, server),
|
|
3264
3284
|
unimport(wxtConfig),
|
|
3265
|
-
|
|
3266
|
-
virtualEntrypoint("content-script-isolated-world", wxtConfig),
|
|
3267
|
-
virtualEntrypoint("content-script-main-world", wxtConfig),
|
|
3268
|
-
virtualEntrypoint("unlisted-script", wxtConfig),
|
|
3285
|
+
resolveVirtualModules(wxtConfig),
|
|
3269
3286
|
devServerGlobals(wxtConfig, server),
|
|
3270
3287
|
tsconfigPaths(wxtConfig),
|
|
3271
3288
|
noopBackground(),
|
|
@@ -3450,7 +3467,11 @@ function getRollupEntry(entrypoint) {
|
|
|
3450
3467
|
virtualEntrypointType = entrypoint.options.world === "MAIN" ? "content-script-main-world" : "content-script-isolated-world";
|
|
3451
3468
|
break;
|
|
3452
3469
|
}
|
|
3453
|
-
|
|
3470
|
+
if (virtualEntrypointType) {
|
|
3471
|
+
const moduleId = `virtual:wxt-${virtualEntrypointType}-entrypoint`;
|
|
3472
|
+
return `${moduleId}?${entrypoint.inputPath}`;
|
|
3473
|
+
}
|
|
3474
|
+
return entrypoint.inputPath;
|
|
3454
3475
|
}
|
|
3455
3476
|
|
|
3456
3477
|
// src/core/wxt.ts
|
|
@@ -3496,11 +3517,30 @@ async function getPublicFiles() {
|
|
|
3496
3517
|
var import_fs_extra5 = __toESM(require("fs-extra"), 1);
|
|
3497
3518
|
var import_path3 = require("path");
|
|
3498
3519
|
var import_picocolors = __toESM(require("picocolors"), 1);
|
|
3520
|
+
|
|
3521
|
+
// src/core/utils/arrays.ts
|
|
3522
|
+
function every(array, predicate) {
|
|
3523
|
+
for (let i = 0; i < array.length; i++)
|
|
3524
|
+
if (!predicate(array[i], i))
|
|
3525
|
+
return false;
|
|
3526
|
+
return true;
|
|
3527
|
+
}
|
|
3528
|
+
function some(array, predicate) {
|
|
3529
|
+
for (let i = 0; i < array.length; i++)
|
|
3530
|
+
if (predicate(array[i], i))
|
|
3531
|
+
return true;
|
|
3532
|
+
return false;
|
|
3533
|
+
}
|
|
3534
|
+
function toArray(a) {
|
|
3535
|
+
return Array.isArray(a) ? a : [a];
|
|
3536
|
+
}
|
|
3537
|
+
|
|
3538
|
+
// src/core/utils/building/build-entrypoints.ts
|
|
3499
3539
|
async function buildEntrypoints(groups, spinner) {
|
|
3500
3540
|
const steps = [];
|
|
3501
3541
|
for (let i = 0; i < groups.length; i++) {
|
|
3502
3542
|
const group = groups[i];
|
|
3503
|
-
const groupNames =
|
|
3543
|
+
const groupNames = toArray(group).map((e) => e.name);
|
|
3504
3544
|
const groupNameColored = groupNames.join(import_picocolors.default.dim(", "));
|
|
3505
3545
|
spinner.text = import_picocolors.default.dim(`[${i + 1}/${groups.length}]`) + ` ${groupNameColored}`;
|
|
3506
3546
|
try {
|
|
@@ -3532,20 +3572,6 @@ async function copyPublicDirectory() {
|
|
|
3532
3572
|
return publicAssets;
|
|
3533
3573
|
}
|
|
3534
3574
|
|
|
3535
|
-
// src/core/utils/arrays.ts
|
|
3536
|
-
function every(array, predicate) {
|
|
3537
|
-
for (let i = 0; i < array.length; i++)
|
|
3538
|
-
if (!predicate(array[i], i))
|
|
3539
|
-
return false;
|
|
3540
|
-
return true;
|
|
3541
|
-
}
|
|
3542
|
-
function some(array, predicate) {
|
|
3543
|
-
for (let i = 0; i < array.length; i++)
|
|
3544
|
-
if (predicate(array[i], i))
|
|
3545
|
-
return true;
|
|
3546
|
-
return false;
|
|
3547
|
-
}
|
|
3548
|
-
|
|
3549
3575
|
// src/core/utils/building/detect-dev-changes.ts
|
|
3550
3576
|
function detectDevChanges(changedFiles, currentOutput) {
|
|
3551
3577
|
const isConfigChange = some(
|
|
@@ -4805,7 +4831,7 @@ function getChunkSortWeight(filename) {
|
|
|
4805
4831
|
var import_picocolors4 = __toESM(require("picocolors"), 1);
|
|
4806
4832
|
|
|
4807
4833
|
// package.json
|
|
4808
|
-
var version = "0.17.
|
|
4834
|
+
var version = "0.17.11";
|
|
4809
4835
|
|
|
4810
4836
|
// src/core/utils/log/printHeader.ts
|
|
4811
4837
|
var import_consola2 = require("consola");
|
|
@@ -4920,6 +4946,9 @@ function mapWxtOptionsToRegisteredContentScript(options, js, css) {
|
|
|
4920
4946
|
world: options.world
|
|
4921
4947
|
};
|
|
4922
4948
|
}
|
|
4949
|
+
function getContentScriptJs(config, entrypoint) {
|
|
4950
|
+
return [getEntrypointBundlePath(entrypoint, config.outDir, ".js")];
|
|
4951
|
+
}
|
|
4923
4952
|
|
|
4924
4953
|
// src/core/utils/manifest.ts
|
|
4925
4954
|
var import_defu2 = __toESM(require("defu"), 1);
|
|
@@ -5971,7 +6000,7 @@ function reloadContentScripts(steps, server) {
|
|
|
5971
6000
|
const entry = step.entrypoints;
|
|
5972
6001
|
if (Array.isArray(entry) || entry.type !== "content-script")
|
|
5973
6002
|
return;
|
|
5974
|
-
const js =
|
|
6003
|
+
const js = getContentScriptJs(wxt.config, entry);
|
|
5975
6004
|
const cssMap = getContentScriptsCssMap(server.currentOutput, [entry]);
|
|
5976
6005
|
const css = getContentScriptCssFiles([entry], cssMap);
|
|
5977
6006
|
server.reloadContentScript({
|
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-
|
|
2
|
-
export { w as BackgroundDefinition, m as BackgroundEntrypoint, h as BackgroundEntrypointOptions, i as BaseContentScriptEntrypointOptions, l as BaseEntrypoint, g as BaseEntrypointOptions, d as BuildStepOutput, H as ConfigEnv, v as ContentScriptDefinition, C as ContentScriptEntrypoint,
|
|
1
|
+
import { I as InlineConfig, B as BuildOutput, U as UserConfig, E as ExtensionRunnerConfig, W as WxtDevServer } from './index-2A45qoLY.cjs';
|
|
2
|
+
export { w as BackgroundDefinition, m as BackgroundEntrypoint, h as BackgroundEntrypointOptions, i as BaseContentScriptEntrypointOptions, l as BaseEntrypoint, g as BaseEntrypointOptions, d as BuildStepOutput, H as ConfigEnv, v as ContentScriptDefinition, C as ContentScriptEntrypoint, a5 as Dependency, q as Entrypoint, r as EntrypointGroup, $ as EslintGlobalsPropValue, a0 as Eslintrc, _ as ExtensionRunner, Z as FsCache, G as GenericEntrypoint, V as HookResult, t as IsolatedWorldContentScriptDefinition, j as IsolatedWorldContentScriptEntrypointOptions, L as Logger, u as MainWorldContentScriptDefinition, M as MainWorldContentScriptEntrypointOptions, s as OnContentScriptStopped, o as OptionsEntrypoint, k as OptionsEntrypointOptions, c as OutputAsset, b as OutputChunk, O as OutputFile, z as PerBrowserMap, y as PerBrowserOption, n as PopupEntrypoint, P as PopupEntrypointOptions, e as ReloadContentScriptPayload, R as ResolvedConfig, a1 as ResolvedEslintrc, A as ResolvedPerBrowserOptions, Q as ServerInfo, p as SidepanelEntrypoint, S as SidepanelEntrypointOptions, T as TargetBrowser, f as TargetManifestVersion, x as UnlistedScriptDefinition, D as UserManifest, F as UserManifestFn, Y as Wxt, K as WxtBuilder, N as WxtBuilderServer, J as WxtCommand, X as WxtHooks, a4 as WxtPackageManager, a3 as WxtResolvedUnimportOptions, a2 as WxtUnimportOptions, a as WxtViteConfig } from './index-2A45qoLY.cjs';
|
|
3
3
|
import 'vite';
|
|
4
4
|
import 'webextension-polyfill';
|
|
5
5
|
import 'unimport';
|
|
@@ -65,6 +65,6 @@ declare function prepare(config: InlineConfig): Promise<void>;
|
|
|
65
65
|
*/
|
|
66
66
|
declare function zip(config?: InlineConfig): Promise<string[]>;
|
|
67
67
|
|
|
68
|
-
var version = "0.17.
|
|
68
|
+
var version = "0.17.11";
|
|
69
69
|
|
|
70
70
|
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-
|
|
2
|
-
export { w as BackgroundDefinition, m as BackgroundEntrypoint, h as BackgroundEntrypointOptions, i as BaseContentScriptEntrypointOptions, l as BaseEntrypoint, g as BaseEntrypointOptions, d as BuildStepOutput, H as ConfigEnv, v as ContentScriptDefinition, C as ContentScriptEntrypoint,
|
|
1
|
+
import { I as InlineConfig, B as BuildOutput, U as UserConfig, E as ExtensionRunnerConfig, W as WxtDevServer } from './index-2A45qoLY.js';
|
|
2
|
+
export { w as BackgroundDefinition, m as BackgroundEntrypoint, h as BackgroundEntrypointOptions, i as BaseContentScriptEntrypointOptions, l as BaseEntrypoint, g as BaseEntrypointOptions, d as BuildStepOutput, H as ConfigEnv, v as ContentScriptDefinition, C as ContentScriptEntrypoint, a5 as Dependency, q as Entrypoint, r as EntrypointGroup, $ as EslintGlobalsPropValue, a0 as Eslintrc, _ as ExtensionRunner, Z as FsCache, G as GenericEntrypoint, V as HookResult, t as IsolatedWorldContentScriptDefinition, j as IsolatedWorldContentScriptEntrypointOptions, L as Logger, u as MainWorldContentScriptDefinition, M as MainWorldContentScriptEntrypointOptions, s as OnContentScriptStopped, o as OptionsEntrypoint, k as OptionsEntrypointOptions, c as OutputAsset, b as OutputChunk, O as OutputFile, z as PerBrowserMap, y as PerBrowserOption, n as PopupEntrypoint, P as PopupEntrypointOptions, e as ReloadContentScriptPayload, R as ResolvedConfig, a1 as ResolvedEslintrc, A as ResolvedPerBrowserOptions, Q as ServerInfo, p as SidepanelEntrypoint, S as SidepanelEntrypointOptions, T as TargetBrowser, f as TargetManifestVersion, x as UnlistedScriptDefinition, D as UserManifest, F as UserManifestFn, Y as Wxt, K as WxtBuilder, N as WxtBuilderServer, J as WxtCommand, X as WxtHooks, a4 as WxtPackageManager, a3 as WxtResolvedUnimportOptions, a2 as WxtUnimportOptions, a as WxtViteConfig } from './index-2A45qoLY.js';
|
|
3
3
|
import 'vite';
|
|
4
4
|
import 'webextension-polyfill';
|
|
5
5
|
import 'unimport';
|
|
@@ -65,6 +65,6 @@ declare function prepare(config: InlineConfig): Promise<void>;
|
|
|
65
65
|
*/
|
|
66
66
|
declare function zip(config?: InlineConfig): Promise<string[]>;
|
|
67
67
|
|
|
68
|
-
var version = "0.17.
|
|
68
|
+
var version = "0.17.11";
|
|
69
69
|
|
|
70
70
|
export { BuildOutput, ExtensionRunnerConfig, InlineConfig, UserConfig, WxtDevServer, build, clean, createServer, defineConfig, defineRunnerConfig, initialize, prepare, version, zip };
|
package/dist/index.js
CHANGED
|
@@ -4,6 +4,7 @@ import {
|
|
|
4
4
|
formatDuration,
|
|
5
5
|
generateTypesDir,
|
|
6
6
|
getContentScriptCssFiles,
|
|
7
|
+
getContentScriptJs,
|
|
7
8
|
getContentScriptsCssMap,
|
|
8
9
|
getEntrypointBundlePath,
|
|
9
10
|
getPackageJson,
|
|
@@ -18,7 +19,8 @@ import {
|
|
|
18
19
|
unnormalizePath,
|
|
19
20
|
version,
|
|
20
21
|
wxt
|
|
21
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-XFXYT75Z.js";
|
|
23
|
+
import "./chunk-5X3S6AWF.js";
|
|
22
24
|
import "./chunk-VBXJIVYU.js";
|
|
23
25
|
|
|
24
26
|
// src/core/build.ts
|
|
@@ -368,7 +370,7 @@ function reloadContentScripts(steps, server) {
|
|
|
368
370
|
const entry = step.entrypoints;
|
|
369
371
|
if (Array.isArray(entry) || entry.type !== "content-script")
|
|
370
372
|
return;
|
|
371
|
-
const js =
|
|
373
|
+
const js = getContentScriptJs(wxt.config, entry);
|
|
372
374
|
const cssMap = getContentScriptsCssMap(server.currentOutput, [entry]);
|
|
373
375
|
const css = getContentScriptCssFiles([entry], cssMap);
|
|
374
376
|
server.reloadContentScript({
|
package/dist/storage.cjs
CHANGED
|
@@ -60,6 +60,11 @@ var logger = {
|
|
|
60
60
|
error: (...args) => print(console.error, ...args)
|
|
61
61
|
};
|
|
62
62
|
|
|
63
|
+
// src/core/utils/arrays.ts
|
|
64
|
+
function toArray(a) {
|
|
65
|
+
return Array.isArray(a) ? a : [a];
|
|
66
|
+
}
|
|
67
|
+
|
|
63
68
|
// src/storage.ts
|
|
64
69
|
var storage = createStorage();
|
|
65
70
|
function createStorage() {
|
|
@@ -132,7 +137,7 @@ function createStorage() {
|
|
|
132
137
|
await driver.removeItem(metaKey);
|
|
133
138
|
} else {
|
|
134
139
|
const newFields = getMetaValue(await driver.getItem(metaKey));
|
|
135
|
-
|
|
140
|
+
toArray(properties).forEach((field) => delete newFields[field]);
|
|
136
141
|
await driver.setItem(metaKey, newFields);
|
|
137
142
|
}
|
|
138
143
|
};
|
package/dist/storage.js
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import {
|
|
2
|
+
toArray
|
|
3
|
+
} from "./chunk-5X3S6AWF.js";
|
|
1
4
|
import "./chunk-VBXJIVYU.js";
|
|
2
5
|
|
|
3
6
|
// src/browser.ts
|
|
@@ -97,7 +100,7 @@ function createStorage() {
|
|
|
97
100
|
await driver.removeItem(metaKey);
|
|
98
101
|
} else {
|
|
99
102
|
const newFields = getMetaValue(await driver.getItem(metaKey));
|
|
100
|
-
|
|
103
|
+
toArray(properties).forEach((field) => delete newFields[field]);
|
|
101
104
|
await driver.setItem(metaKey, newFields);
|
|
102
105
|
}
|
|
103
106
|
};
|
package/dist/testing.cjs
CHANGED
|
@@ -162,7 +162,23 @@ function unimport(config) {
|
|
|
162
162
|
};
|
|
163
163
|
}
|
|
164
164
|
|
|
165
|
-
// src/core/
|
|
165
|
+
// src/core/utils/virtual-modules.ts
|
|
166
|
+
var virtualEntrypointTypes = [
|
|
167
|
+
"content-script-main-world",
|
|
168
|
+
"content-script-isolated-world",
|
|
169
|
+
"background",
|
|
170
|
+
"unlisted-script"
|
|
171
|
+
];
|
|
172
|
+
var virtualEntrypointModuleNames = virtualEntrypointTypes.map(
|
|
173
|
+
(name) => `${name}-entrypoint`
|
|
174
|
+
);
|
|
175
|
+
var virtualModuleNames = [
|
|
176
|
+
...virtualEntrypointModuleNames,
|
|
177
|
+
"mock-browser",
|
|
178
|
+
"reload-html"
|
|
179
|
+
];
|
|
180
|
+
|
|
181
|
+
// src/core/builders/vite/plugins/resolveVirtualModules.ts
|
|
166
182
|
var import_fs_extra2 = __toESM(require("fs-extra"), 1);
|
|
167
183
|
|
|
168
184
|
// src/core/builders/vite/plugins/tsconfigPaths.ts
|
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-2A45qoLY.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-2A45qoLY.js';
|
|
4
4
|
import 'webextension-polyfill';
|
|
5
5
|
import 'unimport';
|
|
6
6
|
import 'consola';
|
package/dist/testing.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// src/virtual/content-script-isolated-world-entrypoint.ts
|
|
2
|
-
import definition from "virtual:user-content-script-isolated-world";
|
|
2
|
+
import definition from "virtual:user-content-script-isolated-world-entrypoint";
|
|
3
3
|
|
|
4
4
|
// src/sandbox/utils/logger.ts
|
|
5
5
|
function print(method, ...args) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// src/virtual/content-script-main-world-entrypoint.ts
|
|
2
|
-
import definition from "virtual:user-content-script-main-world";
|
|
2
|
+
import definition from "virtual:user-content-script-main-world-entrypoint";
|
|
3
3
|
|
|
4
4
|
// src/sandbox/utils/logger.ts
|
|
5
5
|
function print(method, ...args) {
|