extension-develop 4.1.27 → 4.1.28
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/832~0.mjs +1 -1
- package/dist/840~0.mjs +13 -2
- package/dist/plugin-reload/classify-reload.d.ts +1 -0
- package/package.json +1 -1
package/dist/832~0.mjs
CHANGED
|
@@ -18,7 +18,7 @@ import * as __rspack_external_node_fs_1b05aee1 from "node:fs";
|
|
|
18
18
|
import * as __rspack_external_node_os_4f3c9d58 from "node:os";
|
|
19
19
|
import * as __rspack_external_node_path_806ed179 from "node:path";
|
|
20
20
|
import * as __rspack_external_node_vm_ef240610 from "node:vm";
|
|
21
|
-
var package_namespaceObject = /*#__PURE__*/ JSON.parse('{"rE":"4.1.
|
|
21
|
+
var package_namespaceObject = /*#__PURE__*/ JSON.parse('{"rE":"4.1.28","El":{"@prefresh/core":"1.5.9","@prefresh/utils":"1.2.1","@rspack/core":"2.2.3","@rspack/dev-server":"2.1.0","@rspack/plugin-preact-refresh":"2.0.1","@rspack/plugin-react-refresh":"2.0.2","@vue/compiler-sfc":"3.5.26","acorn":"^8.16.0","browser-extension-manifest-fields":"^3.0.2","case-sensitive-paths-webpack-plugin":"^2.4.0","content-security-policy-parser":"^0.6.0","cross-spawn":"^7.0.6","dotenv":"^18.0.0","es-module-lexer":"^3.0.2","extension-from-store":"^0.2.5","fflate":"^0.8.3","go-git-it":"^5.1.5","ignore":"^7.0.5","less":"4.9.1","less-loader":"13.0.0","parse5-utilities":"^1.0.0","pintor":"0.3.0","postcss":"8.5.23","postcss-loader":"8.2.1","postcss-preset-env":"11.1.1","postcss-scss":"4.0.9","preact":"10.27.3","prefers-yarn":"2.0.1","react-refresh":"0.18.0","sass-loader":"17.0.0","schema-utils":"^4.3.3","svelte-loader":"3.2.4","tiny-glob":"^0.2.9","vue":"3.5.26","vue-loader":"17.4.2","webextension-polyfill":"^0.12.0","webpack-merge":"^6.0.1","webpack-target-webextension":"^2.1.3","ws":"^8.20.1"}}');
|
|
22
22
|
const preloadedEnvKeys = new Set();
|
|
23
23
|
function getPreloadedEnvKeys() {
|
|
24
24
|
return preloadedEnvKeys;
|
package/dist/840~0.mjs
CHANGED
|
@@ -2722,6 +2722,17 @@ function formatReloadContextLabel(context, files) {
|
|
|
2722
2722
|
const extra = files.length > 2 ? ` +${files.length - 2} more` : '';
|
|
2723
2723
|
return `${context} (${shown}${extra})`;
|
|
2724
2724
|
}
|
|
2725
|
+
function backgroundContextFromOutput(outputPath) {
|
|
2726
|
+
if (!outputPath) return 'service_worker';
|
|
2727
|
+
try {
|
|
2728
|
+
const manifest = JSON.parse(stripBom(__rspack_external_node_fs_1b05aee1.readFileSync(__rspack_external_node_path_806ed179.join(outputPath, 'manifest.json'), 'utf8')));
|
|
2729
|
+
const background = manifest?.background;
|
|
2730
|
+
if (background?.service_worker) return 'service_worker';
|
|
2731
|
+
if (Array.isArray(background?.scripts)) return "background_script";
|
|
2732
|
+
if (background?.page) return 'background_page';
|
|
2733
|
+
} catch {}
|
|
2734
|
+
return 'service_worker';
|
|
2735
|
+
}
|
|
2725
2736
|
function pageContextFromSources(changedSources) {
|
|
2726
2737
|
const rules = [
|
|
2727
2738
|
[
|
|
@@ -2917,7 +2928,7 @@ function classifyReloadFromSources(opts) {
|
|
|
2917
2928
|
].sort()
|
|
2918
2929
|
} : {},
|
|
2919
2930
|
changedAssets: changedSources,
|
|
2920
|
-
label: formatReloadContextLabel(contentEntries.size > 0 ?
|
|
2931
|
+
label: formatReloadContextLabel(contentEntries.size > 0 ? `${backgroundContextFromOutput(outputPath)} + content_script` : backgroundContextFromOutput(outputPath), swChanged)
|
|
2921
2932
|
});
|
|
2922
2933
|
if (staticAssetChanged) return withScripts({
|
|
2923
2934
|
type: 'full',
|
|
@@ -2941,7 +2952,7 @@ function classifyReloadFromSources(opts) {
|
|
|
2941
2952
|
if (unknown.some(isServiceWorkerSource)) return withScripts({
|
|
2942
2953
|
type: 'service-worker',
|
|
2943
2954
|
changedAssets: changedSources,
|
|
2944
|
-
label: formatReloadContextLabel(
|
|
2955
|
+
label: formatReloadContextLabel(backgroundContextFromOutput(outputPath), changedSources)
|
|
2945
2956
|
});
|
|
2946
2957
|
const contentScriptCount = getContentScriptCount();
|
|
2947
2958
|
if (contentScriptCount > 0) {
|
|
@@ -8,6 +8,7 @@ export interface ReloadInstruction {
|
|
|
8
8
|
}
|
|
9
9
|
/** "context (fileA, fileB +2 more)", the one label every reload surface shows. */
|
|
10
10
|
export declare function formatReloadContextLabel(context: string, files: string[]): string;
|
|
11
|
+
export declare function backgroundContextFromOutput(outputPath?: string): string;
|
|
11
12
|
export declare function pageContextFromSources(changedSources: string[]): string;
|
|
12
13
|
export interface SourceFeatureIndex {
|
|
13
14
|
swSources: Set<string>;
|