extension-develop 4.1.14 → 4.1.16-canary.387.3c3b02c
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/{278.mjs → 105~0.mjs} +13 -13
- package/dist/177~0.mjs +37 -0
- package/dist/273~0.mjs +45 -0
- package/dist/{518.mjs → 300~0.mjs} +44 -85
- package/dist/{266.mjs → 519~0.mjs} +41 -2
- package/dist/{845.mjs → 524~0.mjs} +1 -1
- package/dist/{887.mjs → 616~0.mjs} +16 -16
- package/dist/{93.mjs → 712~0.mjs} +9 -9
- package/dist/{80.mjs → 731~0.mjs} +20 -20
- package/dist/{372.mjs → 747~0.mjs} +9 -8
- package/dist/{101.mjs → 832~0.mjs} +113 -113
- package/dist/{839.mjs → 840~0.mjs} +201 -98
- package/dist/{129.mjs → 88~0.mjs} +8 -8
- package/dist/{77.mjs → 950~0.mjs} +108 -105
- package/dist/bridge-entry.d.ts +10 -10
- package/dist/bridge.mjs +11 -11
- package/dist/command-build.d.ts +2 -2
- package/dist/command-dev.d.ts +2 -2
- package/dist/command-preview.d.ts +1 -1
- package/dist/contracts-entry.d.ts +2 -2
- package/dist/css-parse-guard-loader.mjs +4 -4
- package/dist/dead-css-url-loader.mjs +11 -11
- package/dist/dev-server/cleanup.d.ts +1 -1
- package/dist/dev-server/control-bridge/actions-file.d.ts +1 -1
- package/dist/dev-server/control-bridge/broker.d.ts +5 -5
- package/dist/dev-server/control-bridge/consumer-client.d.ts +2 -2
- package/dist/dev-server/control-bridge/control-port-store.d.ts +1 -1
- package/dist/dev-server/control-bridge/controller-client.d.ts +1 -1
- package/dist/dev-server/control-bridge/logs-file.d.ts +1 -1
- package/dist/dev-server/control-bridge/ring-buffer.d.ts +1 -1
- package/dist/dev-server/control-bridge/session-token.d.ts +1 -1
- package/dist/dev-server/control-bridge/ws-control-server.d.ts +1 -1
- package/dist/dev-server/index.d.ts +2 -2
- package/dist/dev-server/lifecycle-stream.d.ts +1 -1
- package/dist/{0~dev-server.mjs → dev-server~0.mjs} +44 -44
- package/dist/ensure-hmr-for-scripts.js +7 -7
- package/dist/ensure-hmr-for-scripts.mjs +7 -7
- package/dist/extension-js-devtools/chrome/background/service_worker.js +1 -1
- package/dist/extension-js-devtools/chrome/content_scripts/content-0.js +2 -2
- package/dist/extension-js-devtools/chrome/options/index.html +1 -1
- package/dist/extension-js-devtools/chrome/options/index.js +1 -1
- package/dist/extension-js-devtools/chrome/pages/centralized-logger.html +1 -1
- package/dist/extension-js-devtools/chrome/pages/centralized-logger.js +4 -4
- package/dist/extension-js-devtools/chrome/pages/welcome.html +1 -1
- package/dist/extension-js-devtools/chrome/pages/welcome.js +4 -4
- package/dist/extension-js-devtools/chrome/shared/commons.js +1 -0
- package/dist/extension-js-devtools/chrome/shared/framework.js +1 -0
- package/dist/extension-js-devtools/chromium/background/service_worker.js +1 -1
- package/dist/extension-js-devtools/chromium/content_scripts/content-0.js +2 -2
- package/dist/extension-js-devtools/chromium/options/index.html +1 -1
- package/dist/extension-js-devtools/chromium/options/index.js +1 -1
- package/dist/extension-js-devtools/chromium/pages/centralized-logger.html +1 -1
- package/dist/extension-js-devtools/chromium/pages/centralized-logger.js +4 -4
- package/dist/extension-js-devtools/chromium/pages/welcome.html +1 -1
- package/dist/extension-js-devtools/chromium/pages/welcome.js +4 -4
- package/dist/extension-js-devtools/chromium/shared/commons.js +1 -0
- package/dist/extension-js-devtools/chromium/shared/framework.js +1 -0
- package/dist/extension-js-devtools/edge/background/service_worker.js +1 -1
- package/dist/extension-js-devtools/edge/content_scripts/content-0.js +2 -2
- package/dist/extension-js-devtools/edge/options/index.html +1 -1
- package/dist/extension-js-devtools/edge/options/index.js +1 -1
- package/dist/extension-js-devtools/edge/pages/centralized-logger.html +1 -1
- package/dist/extension-js-devtools/edge/pages/centralized-logger.js +4 -4
- package/dist/extension-js-devtools/edge/pages/welcome.html +1 -1
- package/dist/extension-js-devtools/edge/pages/welcome.js +4 -4
- package/dist/extension-js-devtools/edge/shared/commons.js +1 -0
- package/dist/extension-js-devtools/edge/shared/framework.js +1 -0
- package/dist/extension-js-devtools/firefox/background/scripts.js +1 -1
- package/dist/extension-js-devtools/firefox/content_scripts/content-0.js +2 -2
- package/dist/extension-js-devtools/firefox/options/index.html +1 -1
- package/dist/extension-js-devtools/firefox/options/index.js +1 -1
- package/dist/extension-js-devtools/firefox/pages/centralized-logger.html +1 -1
- package/dist/extension-js-devtools/firefox/pages/centralized-logger.js +4 -4
- package/dist/extension-js-devtools/firefox/pages/welcome.html +1 -1
- package/dist/extension-js-devtools/firefox/pages/welcome.js +4 -4
- package/dist/extension-js-devtools/firefox/shared/commons.js +1 -0
- package/dist/extension-js-devtools/firefox/shared/framework.js +1 -0
- package/dist/feature-scripts-classic-concat-loader.js +5 -5
- package/dist/feature-scripts-classic-concat-loader.mjs +5 -5
- package/dist/feature-scripts-content-script-wrapper.js +9 -10
- package/dist/feature-scripts-content-script-wrapper.mjs +9 -10
- package/dist/feature-scripts-native-geturl-import-loader.mjs +1 -1
- package/dist/late-css-import-loader.mjs +4 -4
- package/dist/lib/config-loader.d.ts +1 -1
- package/dist/lib/dark-mode.d.ts +1 -1
- package/dist/lib/ensure-develop-artifacts.d.ts +1 -1
- package/dist/lib/manifest-utils.d.ts +1 -1
- package/dist/lib/messages.d.ts +3 -2
- package/dist/lib/normalize-split-chunks.d.ts +7 -0
- package/dist/lib/optional-deps-contracts.d.ts +1 -1
- package/dist/lib/optional-deps-resolver.d.ts +1 -1
- package/dist/lib/package-manager.d.ts +1 -1
- package/dist/lib/paths.d.ts +1 -1
- package/dist/lib/project-manifest.d.ts +1 -1
- package/dist/lib/split-chunks.d.ts +13 -0
- package/dist/module.d.ts +10 -10
- package/dist/module.mjs +2 -2
- package/dist/plugin-browsers/index.d.ts +1 -1
- package/dist/plugin-browsers/safari-dev-plugin.d.ts +1 -1
- package/dist/plugin-compatibility/compatibility-lib/messages.d.ts +1 -1
- package/dist/plugin-compatibility/feature-polyfill.d.ts +1 -1
- package/dist/plugin-compatibility/index.d.ts +1 -1
- package/dist/plugin-compilation/boring.d.ts +1 -1
- package/dist/plugin-compilation/env.d.ts +1 -1
- package/dist/plugin-compilation/index.d.ts +1 -1
- package/dist/plugin-compilation/zip.d.ts +1 -1
- package/dist/plugin-css/common-style-loaders.d.ts +1 -1
- package/dist/plugin-css/css-in-content-script-loader.d.ts +2 -2
- package/dist/plugin-css/css-in-html-loader.d.ts +2 -2
- package/dist/plugin-css/css-lib/build-css-rules.d.ts +1 -1
- package/dist/plugin-css/css-tools/postcss.d.ts +2 -2
- package/dist/plugin-css/css-tools/sass.d.ts +1 -1
- package/dist/plugin-css/index.d.ts +5 -4
- package/dist/plugin-css/public-css-url-loader.d.ts +13 -0
- package/dist/plugin-js-frameworks/frameworks-lib/integrations.d.ts +2 -2
- package/dist/plugin-js-frameworks/index.d.ts +1 -1
- package/dist/plugin-js-frameworks/js-frameworks-lib/load-loader-options.d.ts +1 -1
- package/dist/plugin-js-frameworks/js-tools/preact.d.ts +1 -1
- package/dist/plugin-js-frameworks/js-tools/react.d.ts +1 -1
- package/dist/plugin-js-frameworks/js-tools/solid.d.ts +1 -1
- package/dist/plugin-js-frameworks/js-tools/svelte.d.ts +1 -1
- package/dist/plugin-js-frameworks/js-tools/typescript.d.ts +1 -1
- package/dist/plugin-js-frameworks/js-tools/vue.d.ts +1 -1
- package/dist/plugin-js-frameworks/swc-targets.d.ts +1 -1
- package/dist/plugin-perf-budgets/index.d.ts +3 -3
- package/dist/plugin-perf-budgets/messages.d.ts +1 -1
- package/dist/plugin-playwright/index.d.ts +2 -2
- package/dist/plugin-reload/index.d.ts +4 -4
- package/dist/plugin-reload/reload-dispatch.d.ts +1 -1
- package/dist/plugin-reload/steps/setup-chunk-loading-target.d.ts +1 -1
- package/dist/plugin-reload/steps/setup-reload-strategy/index.d.ts +1 -1
- package/dist/plugin-reload/steps/setup-reload-strategy/setup-background-entry.d.ts +1 -1
- package/dist/plugin-reload/steps/setup-reload-strategy/webpack-target-webextension-fork/index.d.ts +1 -1
- package/dist/plugin-special-folders/folder-extensions/resolve-config.d.ts +1 -1
- package/dist/plugin-special-folders/folder-extensions/resolve-dirs.d.ts +1 -1
- package/dist/plugin-special-folders/folder-extensions/utils.d.ts +1 -1
- package/dist/plugin-special-folders/get-data.d.ts +2 -2
- package/dist/plugin-static-assets/index.d.ts +1 -1
- package/dist/plugin-wasm/index.d.ts +1 -1
- package/dist/plugin-web-extension/feature-html/html-lib/assets.d.ts +2 -2
- package/dist/plugin-web-extension/feature-html/html-lib/inject.d.ts +12 -1
- package/dist/plugin-web-extension/feature-html/html-lib/patch-html.d.ts +2 -2
- package/dist/plugin-web-extension/feature-html/html-lib/utils.d.ts +2 -2
- package/dist/plugin-web-extension/feature-html/index.d.ts +1 -1
- package/dist/plugin-web-extension/feature-html/steps/add-assets-to-compilation.d.ts +1 -1
- package/dist/plugin-web-extension/feature-html/steps/add-scripts-and-styles-to-compilation.d.ts +1 -1
- package/dist/plugin-web-extension/feature-html/steps/add-to-file-dependencies.d.ts +1 -1
- package/dist/plugin-web-extension/feature-html/steps/emit-html-file.d.ts +1 -1
- package/dist/plugin-web-extension/feature-html/steps/ensure-hmr-for-scripts.d.ts +1 -1
- package/dist/plugin-web-extension/feature-html/steps/handle-common-errors.d.ts +1 -1
- package/dist/plugin-web-extension/feature-html/steps/throw-if-recompile-is-needed.d.ts +1 -1
- package/dist/plugin-web-extension/feature-html/steps/update-html-file.d.ts +3 -2
- package/dist/plugin-web-extension/feature-icons/extract-action-theme-icons.d.ts +1 -1
- package/dist/plugin-web-extension/feature-icons/index.d.ts +1 -1
- package/dist/plugin-web-extension/feature-icons/normalize-keys.d.ts +1 -1
- package/dist/plugin-web-extension/feature-icons/omnibox-fields.d.ts +1 -1
- package/dist/plugin-web-extension/feature-icons/steps/add-to-file-dependencies.d.ts +1 -1
- package/dist/plugin-web-extension/feature-icons/steps/emit-file.d.ts +1 -1
- package/dist/plugin-web-extension/feature-icons/theme-image-fields.d.ts +1 -1
- package/dist/plugin-web-extension/feature-json/index.d.ts +1 -1
- package/dist/plugin-web-extension/feature-locales/index.d.ts +1 -1
- package/dist/plugin-web-extension/feature-manifest/index.d.ts +1 -1
- package/dist/plugin-web-extension/feature-manifest/manifest-lib/gecko-data-collection.d.ts +1 -1
- package/dist/plugin-web-extension/feature-manifest/manifest-lib/manifest.d.ts +2 -2
- package/dist/plugin-web-extension/feature-manifest/manifest-lib/sanitize-fatal-shapes.d.ts +1 -1
- package/dist/plugin-web-extension/feature-manifest/manifest-lib/theme-values.d.ts +1 -1
- package/dist/plugin-web-extension/feature-manifest/manifest-overrides/common/background.d.ts +1 -1
- package/dist/plugin-web-extension/feature-manifest/manifest-overrides/common/chrome_url_overrides.d.ts +1 -1
- package/dist/plugin-web-extension/feature-manifest/manifest-overrides/common/commands.d.ts +1 -1
- package/dist/plugin-web-extension/feature-manifest/manifest-overrides/common/content_scripts.d.ts +1 -1
- package/dist/plugin-web-extension/feature-manifest/manifest-overrides/common/content_security_policy.d.ts +1 -1
- package/dist/plugin-web-extension/feature-manifest/manifest-overrides/common/devtools_page.d.ts +1 -1
- package/dist/plugin-web-extension/feature-manifest/manifest-overrides/common/icons.d.ts +1 -1
- package/dist/plugin-web-extension/feature-manifest/manifest-overrides/common/index.d.ts +1 -1
- package/dist/plugin-web-extension/feature-manifest/manifest-overrides/common/omnibox.d.ts +1 -1
- package/dist/plugin-web-extension/feature-manifest/manifest-overrides/common/options_page.d.ts +1 -1
- package/dist/plugin-web-extension/feature-manifest/manifest-overrides/common/options_ui.d.ts +1 -1
- package/dist/plugin-web-extension/feature-manifest/manifest-overrides/common/page_action.d.ts +1 -1
- package/dist/plugin-web-extension/feature-manifest/manifest-overrides/common/permissions.d.ts +1 -1
- package/dist/plugin-web-extension/feature-manifest/manifest-overrides/common/sandbox.d.ts +1 -1
- package/dist/plugin-web-extension/feature-manifest/manifest-overrides/common/sidebar_action.d.ts +1 -1
- package/dist/plugin-web-extension/feature-manifest/manifest-overrides/common/storage.d.ts +1 -1
- package/dist/plugin-web-extension/feature-manifest/manifest-overrides/common/theme.d.ts +1 -1
- package/dist/plugin-web-extension/feature-manifest/manifest-overrides/common/user_scripts.d.ts +1 -1
- package/dist/plugin-web-extension/feature-manifest/manifest-overrides/common/web_accessible_resources.d.ts +1 -1
- package/dist/plugin-web-extension/feature-manifest/manifest-overrides/index.d.ts +1 -1
- package/dist/plugin-web-extension/feature-manifest/manifest-overrides/mv2/background.d.ts +1 -1
- package/dist/plugin-web-extension/feature-manifest/manifest-overrides/mv2/browser_action.d.ts +1 -1
- package/dist/plugin-web-extension/feature-manifest/manifest-overrides/mv2/chrome_settings_overrides.d.ts +1 -1
- package/dist/plugin-web-extension/feature-manifest/manifest-overrides/mv2/index.d.ts +1 -1
- package/dist/plugin-web-extension/feature-manifest/manifest-overrides/mv2/theme_experiment.d.ts +1 -1
- package/dist/plugin-web-extension/feature-manifest/manifest-overrides/mv3/action.d.ts +1 -1
- package/dist/plugin-web-extension/feature-manifest/manifest-overrides/mv3/background.d.ts +1 -1
- package/dist/plugin-web-extension/feature-manifest/manifest-overrides/mv3/declarative_net_request.d.ts +1 -1
- package/dist/plugin-web-extension/feature-manifest/manifest-overrides/mv3/host_permissions.d.ts +1 -1
- package/dist/plugin-web-extension/feature-manifest/manifest-overrides/mv3/index.d.ts +1 -1
- package/dist/plugin-web-extension/feature-manifest/manifest-overrides/mv3/side_panel.d.ts +1 -1
- package/dist/plugin-web-extension/feature-manifest/steps/apply-dev-defaults-lib/dev-injected-hosts.d.ts +24 -0
- package/dist/plugin-web-extension/feature-manifest/steps/apply-dev-defaults-lib/dev-injected-permissions.d.ts +2 -0
- package/dist/plugin-web-extension/feature-manifest/steps/apply-dev-defaults-lib/patch-background.d.ts +1 -1
- package/dist/plugin-web-extension/feature-manifest/steps/apply-dev-defaults-lib/patch-csp.d.ts +1 -1
- package/dist/plugin-web-extension/feature-manifest/steps/apply-dev-defaults-lib/patch-externally-connectable.d.ts +1 -1
- package/dist/plugin-web-extension/feature-manifest/steps/apply-dev-defaults-lib/patch-web-resources.d.ts +1 -1
- package/dist/plugin-web-extension/feature-manifest/steps/apply-dev-defaults.d.ts +1 -1
- package/dist/plugin-web-extension/feature-manifest/steps/emit-manifest.d.ts +1 -1
- package/dist/plugin-web-extension/feature-manifest/steps/patch-chromium-background.d.ts +1 -1
- package/dist/plugin-web-extension/feature-manifest/steps/patch-chromium-theme-colors.d.ts +1 -1
- package/dist/plugin-web-extension/feature-manifest/steps/patch-dev-content-script-manifest-paths.d.ts +1 -1
- package/dist/plugin-web-extension/feature-manifest/steps/patch-gecko-background.d.ts +1 -1
- package/dist/plugin-web-extension/feature-manifest/steps/patch-war.d.ts +1 -1
- package/dist/plugin-web-extension/feature-manifest/steps/update-manifest.d.ts +1 -1
- package/dist/plugin-web-extension/feature-manifest/steps/validate-theme-values.d.ts +1 -1
- package/dist/plugin-web-extension/feature-scripts/index.d.ts +1 -1
- package/dist/plugin-web-extension/feature-scripts/messages.d.ts +21 -0
- package/dist/plugin-web-extension/feature-scripts/scripts-lib/utils.d.ts +1 -1
- package/dist/plugin-web-extension/feature-scripts/steps/add-content-script-wrapper/get-bridge-scripts.d.ts +1 -1
- package/dist/plugin-web-extension/feature-scripts/steps/add-content-script-wrapper/index.d.ts +1 -1
- package/dist/plugin-web-extension/feature-scripts/steps/add-scripts.d.ts +1 -1
- package/dist/plugin-web-extension/feature-scripts/steps/keep-geturl-imports-native.d.ts +1 -1
- package/dist/plugin-web-extension/feature-scripts/steps/trace-runtime-loaded-files.d.ts +2 -0
- package/dist/plugin-web-extension/feature-scripts/steps/warn-split-initial-chunks.d.ts +7 -0
- package/dist/plugin-web-extension/feature-web-resources/collect-entry-imports.d.ts +1 -1
- package/dist/plugin-web-extension/feature-web-resources/index.d.ts +1 -1
- package/dist/plugin-web-extension/feature-web-resources/steps/collect-content-entry-imports.d.ts +1 -1
- package/dist/plugin-web-extension/index.d.ts +1 -1
- package/dist/plugin-web-extension/shared/discover-devtools-panels.d.ts +1 -1
- package/dist/plugin-web-extension/shared/html-surfaces.d.ts +1 -1
- package/dist/plugin-web-extension/shared/initial-files.d.ts +11 -0
- package/dist/plugin-web-extension/shared/manifest-fields-change-detector.d.ts +1 -1
- package/dist/plugin-web-extension/shared/manifest-fields.d.ts +1 -1
- package/dist/plugin-web-extension/shared/manifest-path-assets.d.ts +1 -1
- package/dist/plugin-web-extension/shared/paths.d.ts +1 -1
- package/dist/preprocessor-passthrough-loader.mjs +3 -3
- package/dist/preview-entry.d.ts +3 -3
- package/dist/preview.mjs +1 -1
- package/dist/public-css-url-loader.mjs +2 -0
- package/dist/rspack-config.d.ts +2 -2
- package/dist/{0~rspack-config.mjs → rspack-config~0.mjs} +905 -655
- package/dist/{0~stats-handler.mjs → stats-handler~0.mjs} +2 -12
- package/dist/types.d.ts +4 -4
- package/dist/{0~zip.mjs → zip~0.mjs} +20 -20
- package/package.json +5 -5
- package/dist/0~rslib-runtime.mjs +0 -28
- /package/dist/{23.mjs → 374~0.mjs} +0 -0
- /package/dist/{291.mjs → 640~0.mjs} +0 -0
- /package/dist/{349.mjs → 852~0.mjs} +0 -0
- /package/dist/{292.mjs → 895~0.mjs} +0 -0
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import { createRequire as __extjsCreateRequire } from "node:module"; const require = __extjsCreateRequire(import.meta.url);
|
|
2
|
-
import * as
|
|
3
|
-
import * as
|
|
2
|
+
import * as __rspack_external_node_fs_1b05aee1 from "node:fs";
|
|
3
|
+
import * as __rspack_external_node_path_806ed179 from "node:path";
|
|
4
4
|
function isUsableDir(candidate) {
|
|
5
5
|
try {
|
|
6
|
-
if (!
|
|
7
|
-
const stat =
|
|
6
|
+
if (!__rspack_external_node_fs_1b05aee1.existsSync(candidate)) return false;
|
|
7
|
+
const stat = __rspack_external_node_fs_1b05aee1.statSync(candidate);
|
|
8
8
|
return 'function' == typeof stat?.isDirectory ? stat.isDirectory() : true;
|
|
9
9
|
} catch {
|
|
10
10
|
return false;
|
|
11
11
|
}
|
|
12
12
|
}
|
|
13
13
|
function inspectPublicFolders(manifestPath, projectRoot) {
|
|
14
|
-
const fromManifest =
|
|
15
|
-
const fromRoot = projectRoot ?
|
|
16
|
-
const sameLocation =
|
|
14
|
+
const fromManifest = __rspack_external_node_path_806ed179.join(__rspack_external_node_path_806ed179.dirname(manifestPath), 'public');
|
|
15
|
+
const fromRoot = projectRoot ? __rspack_external_node_path_806ed179.join(projectRoot, 'public') : fromManifest;
|
|
16
|
+
const sameLocation = __rspack_external_node_path_806ed179.resolve(fromRoot) === __rspack_external_node_path_806ed179.resolve(fromManifest);
|
|
17
17
|
const rootOk = isUsableDir(fromRoot);
|
|
18
18
|
const manifestOk = !sameLocation && isUsableDir(fromManifest);
|
|
19
19
|
return {
|
|
@@ -28,22 +28,22 @@ function resolvePublicFolder(manifestPath, projectRoot) {
|
|
|
28
28
|
return inspectPublicFolders(manifestPath, projectRoot).publicDir;
|
|
29
29
|
}
|
|
30
30
|
function publicFolderOrDefault(manifestPath, projectRoot) {
|
|
31
|
-
return resolvePublicFolder(manifestPath, projectRoot) ||
|
|
31
|
+
return resolvePublicFolder(manifestPath, projectRoot) || __rspack_external_node_path_806ed179.join(projectRoot, 'public');
|
|
32
32
|
}
|
|
33
33
|
function publicResolveRoots(projectRoot, manifestPath) {
|
|
34
|
-
const manifestDir =
|
|
35
|
-
const fromRoot =
|
|
36
|
-
const fromManifest =
|
|
34
|
+
const manifestDir = __rspack_external_node_path_806ed179.dirname(manifestPath);
|
|
35
|
+
const fromRoot = __rspack_external_node_path_806ed179.join(projectRoot, 'public');
|
|
36
|
+
const fromManifest = __rspack_external_node_path_806ed179.join(manifestDir, 'public');
|
|
37
37
|
const roots = [
|
|
38
38
|
fromRoot,
|
|
39
39
|
manifestDir
|
|
40
40
|
];
|
|
41
|
-
if (
|
|
41
|
+
if (__rspack_external_node_path_806ed179.resolve(fromManifest) !== __rspack_external_node_path_806ed179.resolve(fromRoot)) roots.push(fromManifest);
|
|
42
42
|
return roots;
|
|
43
43
|
}
|
|
44
44
|
const publicRootsByCompiler = new WeakMap();
|
|
45
45
|
function rememberPublicRoots(compiler, roots) {
|
|
46
|
-
publicRootsByCompiler.set(compiler, roots.filter(Boolean).map((root)=>
|
|
46
|
+
publicRootsByCompiler.set(compiler, roots.filter(Boolean).map((root)=>__rspack_external_node_path_806ed179.resolve(root)));
|
|
47
47
|
}
|
|
48
48
|
function publicRootsFor(compiler) {
|
|
49
49
|
if (!compiler) return [];
|
package/dist/177~0.mjs
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { createRequire as __extjsCreateRequire } from "node:module"; const require = __extjsCreateRequire(import.meta.url);
|
|
2
|
+
import { publicFolderOrDefault } from "./105~0.mjs";
|
|
3
|
+
import { replaceCssUrlRefs } from "./273~0.mjs";
|
|
4
|
+
import * as __rspack_external_node_fs_1b05aee1 from "node:fs";
|
|
5
|
+
import * as __rspack_external_node_path_806ed179 from "node:path";
|
|
6
|
+
const PUBLIC_ROOT_SCHEME = 'https://extensionjs-public.invalid';
|
|
7
|
+
function isFile(candidate) {
|
|
8
|
+
try {
|
|
9
|
+
return __rspack_external_node_fs_1b05aee1.statSync(candidate).isFile();
|
|
10
|
+
} catch {
|
|
11
|
+
return false;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
function keepPublicRootRefs(source, publicRoot) {
|
|
15
|
+
return replaceCssUrlRefs(source, (request)=>{
|
|
16
|
+
if (!request.startsWith('/') || request.startsWith('//')) return;
|
|
17
|
+
const suffixAt = request.search(/[?#]/);
|
|
18
|
+
const rel = (-1 === suffixAt ? request : request.slice(0, suffixAt)).slice(1);
|
|
19
|
+
if (!rel || !isFile(__rspack_external_node_path_806ed179.join(publicRoot, rel))) return;
|
|
20
|
+
return `${PUBLIC_ROOT_SCHEME}${request}`;
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
function restorePublicRootRefs(source) {
|
|
24
|
+
return source.split(PUBLIC_ROOT_SCHEME).join('');
|
|
25
|
+
}
|
|
26
|
+
function publicCssUrlLoader(source) {
|
|
27
|
+
const { manifestPath, projectPath } = this.getOptions() || {};
|
|
28
|
+
if (!manifestPath || !projectPath) return source;
|
|
29
|
+
try {
|
|
30
|
+
const publicRoot = publicFolderOrDefault(manifestPath, projectPath);
|
|
31
|
+
return keepPublicRootRefs(source, publicRoot);
|
|
32
|
+
} catch {
|
|
33
|
+
return source;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
export default publicCssUrlLoader;
|
|
37
|
+
export { PUBLIC_ROOT_SCHEME, keepPublicRootRefs, restorePublicRootRefs };
|
package/dist/273~0.mjs
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { createRequire as __extjsCreateRequire } from "node:module"; const require = __extjsCreateRequire(import.meta.url);
|
|
2
|
+
import * as __rspack_external_node_fs_1b05aee1 from "node:fs";
|
|
3
|
+
import * as __rspack_external_node_path_806ed179 from "node:path";
|
|
4
|
+
const ASSET_EXT = /\.(png|jpe?g|gif|webp|svg|avif|ico|bmp|cur|woff2?|ttf|otf|eot|mp3|mp4|webm|ogg|wav)$/i;
|
|
5
|
+
const URL_REF = /url\(\s*(?:"([^"\n]*)"|'([^'\n]*)'|([^)'"\s]*))\s*\)/g;
|
|
6
|
+
function toPosixPath(value) {
|
|
7
|
+
return String(value).split(__rspack_external_node_path_806ed179.sep).join('/');
|
|
8
|
+
}
|
|
9
|
+
function isDeadCssUrlRef(rawRequest, { issuerDir, roots }) {
|
|
10
|
+
const req = String(rawRequest).split('?')[0].split('#')[0];
|
|
11
|
+
if (!req || req.startsWith('//') || /^[a-z][a-z0-9+.-]*:/i.test(req)) return false;
|
|
12
|
+
if (req.startsWith('~') || req.startsWith('@')) return false;
|
|
13
|
+
const isRootRef = req.startsWith('/');
|
|
14
|
+
const isRelativeRef = req.startsWith('./') || req.startsWith('../');
|
|
15
|
+
const isBareAssetRef = !isRootRef && !isRelativeRef && ASSET_EXT.test(req);
|
|
16
|
+
if (!isRootRef && !isRelativeRef && !isBareAssetRef) return false;
|
|
17
|
+
const candidates = isRootRef ? roots.map((root)=>__rspack_external_node_path_806ed179.join(root, req.slice(1))) : [
|
|
18
|
+
__rspack_external_node_path_806ed179.resolve(issuerDir, req),
|
|
19
|
+
...isBareAssetRef ? roots.map((root)=>__rspack_external_node_path_806ed179.join(root, req)) : []
|
|
20
|
+
];
|
|
21
|
+
return !candidates.some((candidate)=>__rspack_external_node_fs_1b05aee1.existsSync(candidate));
|
|
22
|
+
}
|
|
23
|
+
function replaceCssUrlRefs(source, replacer) {
|
|
24
|
+
return source.replace(URL_REF, (whole, dq, sq, bare)=>{
|
|
25
|
+
const request = dq ?? sq ?? bare ?? '';
|
|
26
|
+
if (!request) return whole;
|
|
27
|
+
const next = replacer(request);
|
|
28
|
+
if (void 0 === next) return whole;
|
|
29
|
+
return `url("${next.replace(/["\\]/g, '\\$&')}")`;
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
function extractCssUrlRefs(source) {
|
|
33
|
+
const found = [];
|
|
34
|
+
const seen = new Set();
|
|
35
|
+
URL_REF.lastIndex = 0;
|
|
36
|
+
let match;
|
|
37
|
+
while(null !== (match = URL_REF.exec(source))){
|
|
38
|
+
const request = match[1] ?? match[2] ?? match[3] ?? '';
|
|
39
|
+
if (!request || seen.has(request)) continue;
|
|
40
|
+
seen.add(request);
|
|
41
|
+
found.push(request);
|
|
42
|
+
}
|
|
43
|
+
return found;
|
|
44
|
+
}
|
|
45
|
+
export { extractCssUrlRefs, isDeadCssUrlRef, replaceCssUrlRefs, toPosixPath };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { createRequire as __extjsCreateRequire } from "node:module"; const require = __extjsCreateRequire(import.meta.url);
|
|
2
|
-
import { inspectPublicFolders } from "./
|
|
3
|
-
import * as
|
|
4
|
-
import * as
|
|
5
|
-
import * as
|
|
2
|
+
import { inspectPublicFolders } from "./105~0.mjs";
|
|
3
|
+
import * as __rspack_external_node_fs_1b05aee1 from "node:fs";
|
|
4
|
+
import * as __rspack_external_node_path_806ed179 from "node:path";
|
|
5
|
+
import * as __rspack_external_parse5_utilities_4a00fdd6 from "parse5-utilities";
|
|
6
6
|
function normalizeManifestOutputPath(originalPath) {
|
|
7
7
|
if (!originalPath) return originalPath;
|
|
8
8
|
const unixPath = originalPath.replace(/\\/g, '/');
|
|
@@ -17,9 +17,9 @@ function manifestPageOutputTarget(raw, compiledTarget, manifestPath) {
|
|
|
17
17
|
if (/^\//.test(unixPath)) {
|
|
18
18
|
const rest = unixPath.replace(/^\/+/, '');
|
|
19
19
|
if (manifestPath && rest) {
|
|
20
|
-
const manifestDir =
|
|
21
|
-
const inPublic =
|
|
22
|
-
const inRoot =
|
|
20
|
+
const manifestDir = __rspack_external_node_path_806ed179.dirname(manifestPath);
|
|
21
|
+
const inPublic = __rspack_external_node_fs_1b05aee1.existsSync(__rspack_external_node_path_806ed179.join(manifestDir, 'public', rest));
|
|
22
|
+
const inRoot = __rspack_external_node_fs_1b05aee1.existsSync(__rspack_external_node_path_806ed179.join(manifestDir, rest));
|
|
23
23
|
if (inRoot && !inPublic) return compiledTarget;
|
|
24
24
|
}
|
|
25
25
|
return normalizeManifestOutputPath(unixPath);
|
|
@@ -31,10 +31,10 @@ function manifestJsonOutputTarget(raw, compiledTarget, manifestPath, projectPath
|
|
|
31
31
|
if (/^(?:\/public\/|(?:\.\/)?public\/|\/)/i.test(unixPath) || !manifestPath) return manifestPageOutputTarget(unixPath, compiledTarget, manifestPath);
|
|
32
32
|
const rest = unixPath.replace(/^\.\//, '');
|
|
33
33
|
if (!rest || rest.split('/').includes('..')) return compiledTarget;
|
|
34
|
-
const manifestDir =
|
|
35
|
-
if (
|
|
34
|
+
const manifestDir = __rspack_external_node_path_806ed179.dirname(manifestPath);
|
|
35
|
+
if (__rspack_external_node_fs_1b05aee1.existsSync(__rspack_external_node_path_806ed179.join(manifestDir, rest))) return compiledTarget;
|
|
36
36
|
const { publicDir } = inspectPublicFolders(manifestPath, projectPath);
|
|
37
|
-
if (publicDir &&
|
|
37
|
+
if (publicDir && __rspack_external_node_fs_1b05aee1.existsSync(__rspack_external_node_path_806ed179.join(publicDir, rest))) return rest;
|
|
38
38
|
return compiledTarget;
|
|
39
39
|
}
|
|
40
40
|
function pathEscapesExtensionRoot(normalized) {
|
|
@@ -179,7 +179,7 @@ function getAssetsFromHtml(htmlFilePath, htmlContent) {
|
|
|
179
179
|
if (!htmlFilePath) return assets;
|
|
180
180
|
let cacheKey;
|
|
181
181
|
if (void 0 === htmlContent) try {
|
|
182
|
-
const stat =
|
|
182
|
+
const stat = __rspack_external_node_fs_1b05aee1.statSync(htmlFilePath);
|
|
183
183
|
cacheKey = `${stat.mtimeMs}:${stat.size}`;
|
|
184
184
|
const cached = assetsFromHtmlCache.get(htmlFilePath);
|
|
185
185
|
if (cached && cached.key === cacheKey) return cloneParsedHtmlAsset(cached.assets);
|
|
@@ -187,11 +187,11 @@ function getAssetsFromHtml(htmlFilePath, htmlContent) {
|
|
|
187
187
|
cacheKey = void 0;
|
|
188
188
|
}
|
|
189
189
|
try {
|
|
190
|
-
const htmlString = htmlContent ||
|
|
190
|
+
const htmlString = htmlContent || __rspack_external_node_fs_1b05aee1.readFileSync(htmlFilePath, {
|
|
191
191
|
encoding: 'utf8'
|
|
192
192
|
});
|
|
193
193
|
if (!htmlString) return assets;
|
|
194
|
-
const htmlDocument =
|
|
194
|
+
const htmlDocument = __rspack_external_parse5_utilities_4a00fdd6.parse(htmlString);
|
|
195
195
|
const baseHref = getBaseHref(htmlDocument);
|
|
196
196
|
const getAbsolutePath = (htmlFilePath, filePathWithParts)=>{
|
|
197
197
|
const { cleanPath } = cleanAssetUrl(filePathWithParts);
|
|
@@ -237,7 +237,7 @@ function getHtmlPageDeclaredAssetPath(filepathList, filePath, extension) {
|
|
|
237
237
|
const entryname = Object.keys(filepathList).find((key)=>{
|
|
238
238
|
const includePath = filepathList[key];
|
|
239
239
|
if (includePath === filePath) return true;
|
|
240
|
-
if (!includePath || !
|
|
240
|
+
if (!includePath || !__rspack_external_node_fs_1b05aee1.existsSync(includePath)) return false;
|
|
241
241
|
const assets = getAssetsFromHtml(includePath);
|
|
242
242
|
return Boolean(assets?.js?.includes(filePath) || assets?.css?.includes(filePath));
|
|
243
243
|
}) || '';
|
|
@@ -246,7 +246,7 @@ function getHtmlPageDeclaredAssetPath(filepathList, filePath, extension) {
|
|
|
246
246
|
return `/${entryname.replace(extname, '')}${extension}`;
|
|
247
247
|
}
|
|
248
248
|
function getExtname(filePath) {
|
|
249
|
-
return
|
|
249
|
+
return __rspack_external_node_path_806ed179.extname(filePath);
|
|
250
250
|
}
|
|
251
251
|
function getFilePath(filePath, extension, isPublic) {
|
|
252
252
|
if (isPublic) return `/${filePath}${extension}`;
|
|
@@ -279,10 +279,10 @@ function rewriteSrcsetCandidate(srcset, fromCleanPath, toUrl) {
|
|
|
279
279
|
}
|
|
280
280
|
function applyRewrittenStaticUrl(node, attributeName, cleanPath, value) {
|
|
281
281
|
if ('srcset' === attributeName || 'imagesrcset' === attributeName) {
|
|
282
|
-
const current =
|
|
283
|
-
return
|
|
282
|
+
const current = __rspack_external_parse5_utilities_4a00fdd6.getAttribute(node, attributeName) || '';
|
|
283
|
+
return __rspack_external_parse5_utilities_4a00fdd6.setAttribute(node, attributeName, rewriteSrcsetCandidate(current, cleanPath, value));
|
|
284
284
|
}
|
|
285
|
-
return
|
|
285
|
+
return __rspack_external_parse5_utilities_4a00fdd6.setAttribute(node, attributeName, value);
|
|
286
286
|
}
|
|
287
287
|
function cleanAssetUrl(url) {
|
|
288
288
|
const hashIndex = url.indexOf('#');
|
|
@@ -310,16 +310,16 @@ function cleanLeading(s) {
|
|
|
310
310
|
return s.replace(/^\/+/, '').replace(/^\.\//, '').replace(/^\./, '');
|
|
311
311
|
}
|
|
312
312
|
function joinEmittedAssetName(prefix, rel) {
|
|
313
|
-
const parts =
|
|
313
|
+
const parts = __rspack_external_node_path_806ed179.posix.join(prefix, rel).split('/');
|
|
314
314
|
let i = 0;
|
|
315
315
|
while(i < parts.length && ('..' === parts[i] || '.' === parts[i]))i++;
|
|
316
|
-
return parts.slice(i).join('/') ||
|
|
316
|
+
return parts.slice(i).join('/') || __rspack_external_node_path_806ed179.posix.basename(rel);
|
|
317
317
|
}
|
|
318
318
|
function htmlStaticAssetOutputName(manifestDir, htmlEntry, absolutePath) {
|
|
319
319
|
if ('string' == typeof manifestDir && manifestDir) {
|
|
320
|
-
const rel =
|
|
321
|
-
if (rel && !
|
|
322
|
-
const posix = rel.split(
|
|
320
|
+
const rel = __rspack_external_node_path_806ed179.relative(manifestDir, absolutePath);
|
|
321
|
+
if (rel && !__rspack_external_node_path_806ed179.isAbsolute(rel)) {
|
|
322
|
+
const posix = rel.split(__rspack_external_node_path_806ed179.sep).join('/');
|
|
323
323
|
const escapes = posix.split('/').includes('..');
|
|
324
324
|
return escapes ? externalAssetOutputPath(posix, 'assets') : joinEmittedAssetName('assets', posix);
|
|
325
325
|
}
|
|
@@ -327,14 +327,14 @@ function htmlStaticAssetOutputName(manifestDir, htmlEntry, absolutePath) {
|
|
|
327
327
|
return joinEmittedAssetName('assets', computePosixRelative(htmlEntry, absolutePath));
|
|
328
328
|
}
|
|
329
329
|
function computePosixRelative(fromPath, toPath) {
|
|
330
|
-
const fromRoot =
|
|
331
|
-
const toRoot =
|
|
330
|
+
const fromRoot = __rspack_external_node_path_806ed179.parse(fromPath).root;
|
|
331
|
+
const toRoot = __rspack_external_node_path_806ed179.parse(toPath).root;
|
|
332
332
|
if (fromRoot && toRoot && String(fromRoot).toLowerCase() !== String(toRoot).toLowerCase()) {
|
|
333
|
-
const base =
|
|
334
|
-
return base.split(
|
|
333
|
+
const base = __rspack_external_node_path_806ed179.basename(toPath);
|
|
334
|
+
return base.split(__rspack_external_node_path_806ed179.sep).join('/');
|
|
335
335
|
}
|
|
336
|
-
const rel =
|
|
337
|
-
return rel.split(
|
|
336
|
+
const rel = __rspack_external_node_path_806ed179.relative(__rspack_external_node_path_806ed179.dirname(fromPath), toPath) || toPath;
|
|
337
|
+
return rel.split(__rspack_external_node_path_806ed179.sep).join('/');
|
|
338
338
|
}
|
|
339
339
|
function resolveAbsoluteFsPath(params) {
|
|
340
340
|
const { asset, projectRoot, publicRootForResource, outputRoot, manifestRoot } = params;
|
|
@@ -342,24 +342,24 @@ function resolveAbsoluteFsPath(params) {
|
|
|
342
342
|
const rootUrlIsClaimed = (value)=>{
|
|
343
343
|
const normalized = cleanLeading(value.slice(1));
|
|
344
344
|
const withoutPublicPrefix = normalized.replace(/^public\//, '');
|
|
345
|
-
if (
|
|
346
|
-
return Boolean(manifestRoot &&
|
|
345
|
+
if (__rspack_external_node_fs_1b05aee1.existsSync(__rspack_external_node_path_806ed179.join(publicRootForResource, withoutPublicPrefix))) return true;
|
|
346
|
+
return Boolean(manifestRoot && __rspack_external_node_fs_1b05aee1.existsSync(__rspack_external_node_path_806ed179.join(manifestRoot, normalized)));
|
|
347
347
|
};
|
|
348
|
-
const isRootUrl = looksLikeRootUrl && (rootUrlIsClaimed(asset) || !
|
|
348
|
+
const isRootUrl = looksLikeRootUrl && (rootUrlIsClaimed(asset) || !__rspack_external_node_fs_1b05aee1.existsSync(asset));
|
|
349
349
|
const isDotPublic = asset.startsWith('./public/');
|
|
350
350
|
const isPlainPublic = asset.startsWith('public/');
|
|
351
351
|
const absoluteFsPath = isRootUrl ? (()=>{
|
|
352
352
|
const rootRelative = asset.slice(1);
|
|
353
353
|
const normalized = cleanLeading(rootRelative);
|
|
354
354
|
const withoutPublicPrefix = normalized.replace(/^public\//, '');
|
|
355
|
-
const candidate =
|
|
356
|
-
if (
|
|
357
|
-
const manifestCandidate = manifestRoot ?
|
|
358
|
-
if (manifestCandidate &&
|
|
355
|
+
const candidate = __rspack_external_node_path_806ed179.join(publicRootForResource, withoutPublicPrefix);
|
|
356
|
+
if (__rspack_external_node_fs_1b05aee1.existsSync(candidate)) return candidate;
|
|
357
|
+
const manifestCandidate = manifestRoot ? __rspack_external_node_path_806ed179.join(manifestRoot, normalized) : '';
|
|
358
|
+
if (manifestCandidate && __rspack_external_node_fs_1b05aee1.existsSync(manifestCandidate)) return manifestCandidate;
|
|
359
359
|
return manifestCandidate || candidate;
|
|
360
|
-
})() : isDotPublic ?
|
|
361
|
-
const relToPublic =
|
|
362
|
-
const isUnderPublicRoot = relToPublic && !relToPublic.startsWith('..') && !
|
|
360
|
+
})() : isDotPublic ? __rspack_external_node_path_806ed179.join(projectRoot, cleanLeading(asset)) : isPlainPublic ? __rspack_external_node_path_806ed179.join(projectRoot, asset.replace(/^\./, '')) : __rspack_external_node_path_806ed179.isAbsolute(asset) ? asset : __rspack_external_node_path_806ed179.join(projectRoot, asset);
|
|
361
|
+
const relToPublic = __rspack_external_node_path_806ed179.relative(publicRootForResource, absoluteFsPath);
|
|
362
|
+
const isUnderPublicRoot = relToPublic && !relToPublic.startsWith('..') && !__rspack_external_node_path_806ed179.isAbsolute(relToPublic);
|
|
363
363
|
return {
|
|
364
364
|
absoluteFsPath,
|
|
365
365
|
isUnderPublicRoot: Boolean(isUnderPublicRoot),
|
|
@@ -369,11 +369,11 @@ function resolveAbsoluteFsPath(params) {
|
|
|
369
369
|
function resolveHtmlRefPath(htmlFilePath, baseHref, cleanPath) {
|
|
370
370
|
if (utils_isUrl(cleanPath)) return cleanPath;
|
|
371
371
|
if (cleanPath.startsWith('/')) return cleanPath;
|
|
372
|
-
const htmlDir =
|
|
373
|
-
const pageRelative =
|
|
372
|
+
const htmlDir = __rspack_external_node_path_806ed179.dirname(htmlFilePath);
|
|
373
|
+
const pageRelative = __rspack_external_node_path_806ed179.join(htmlDir, cleanPath);
|
|
374
374
|
if (!baseHref || utils_isUrl(baseHref)) return pageRelative;
|
|
375
|
-
const throughBase =
|
|
376
|
-
if (
|
|
375
|
+
const throughBase = __rspack_external_node_path_806ed179.join(htmlDir, baseHref, cleanPath);
|
|
376
|
+
if (__rspack_external_node_fs_1b05aee1.existsSync(throughBase) || !__rspack_external_node_fs_1b05aee1.existsSync(pageRelative)) return throughBase;
|
|
377
377
|
return pageRelative;
|
|
378
378
|
}
|
|
379
379
|
function getBaseHref(htmlDocument) {
|
|
@@ -390,45 +390,4 @@ function getBaseNode(htmlDocument) {
|
|
|
390
390
|
}
|
|
391
391
|
}
|
|
392
392
|
}
|
|
393
|
-
|
|
394
|
-
const URL_REF = /url\(\s*(?:"([^"\n]*)"|'([^'\n]*)'|([^)'"\s]*))\s*\)/g;
|
|
395
|
-
function toPosixPath(value) {
|
|
396
|
-
return String(value).split(__rspack_external_node_path_c5b9b54f.sep).join('/');
|
|
397
|
-
}
|
|
398
|
-
function isDeadCssUrlRef(rawRequest, { issuerDir, roots }) {
|
|
399
|
-
const req = String(rawRequest).split('?')[0].split('#')[0];
|
|
400
|
-
if (!req || req.startsWith('//') || /^[a-z][a-z0-9+.-]*:/i.test(req)) return false;
|
|
401
|
-
if (req.startsWith('~') || req.startsWith('@')) return false;
|
|
402
|
-
const isRootRef = req.startsWith('/');
|
|
403
|
-
const isRelativeRef = req.startsWith('./') || req.startsWith('../');
|
|
404
|
-
const isBareAssetRef = !isRootRef && !isRelativeRef && ASSET_EXT.test(req);
|
|
405
|
-
if (!isRootRef && !isRelativeRef && !isBareAssetRef) return false;
|
|
406
|
-
const candidates = isRootRef ? roots.map((root)=>__rspack_external_node_path_c5b9b54f.join(root, req.slice(1))) : [
|
|
407
|
-
__rspack_external_node_path_c5b9b54f.resolve(issuerDir, req),
|
|
408
|
-
...isBareAssetRef ? roots.map((root)=>__rspack_external_node_path_c5b9b54f.join(root, req)) : []
|
|
409
|
-
];
|
|
410
|
-
return !candidates.some((candidate)=>__rspack_external_node_fs_5ea92f0c.existsSync(candidate));
|
|
411
|
-
}
|
|
412
|
-
function replaceCssUrlRefs(source, replacer) {
|
|
413
|
-
return source.replace(URL_REF, (whole, dq, sq, bare)=>{
|
|
414
|
-
const request = dq ?? sq ?? bare ?? '';
|
|
415
|
-
if (!request) return whole;
|
|
416
|
-
const next = replacer(request);
|
|
417
|
-
if (void 0 === next) return whole;
|
|
418
|
-
return `url("${next.replace(/["\\]/g, '\\$&')}")`;
|
|
419
|
-
});
|
|
420
|
-
}
|
|
421
|
-
function extractCssUrlRefs(source) {
|
|
422
|
-
const found = [];
|
|
423
|
-
const seen = new Set();
|
|
424
|
-
URL_REF.lastIndex = 0;
|
|
425
|
-
let match;
|
|
426
|
-
while(null !== (match = URL_REF.exec(source))){
|
|
427
|
-
const request = match[1] ?? match[2] ?? match[3] ?? '';
|
|
428
|
-
if (!request || seen.has(request)) continue;
|
|
429
|
-
seen.add(request);
|
|
430
|
-
found.push(request);
|
|
431
|
-
}
|
|
432
|
-
return found;
|
|
433
|
-
}
|
|
434
|
-
export { applyRewrittenStaticUrl, cleanAssetUrl, cleanLeading, extractCssUrlRefs, getAssetsFromHtml, getBaseHref, getBaseNode, getExtname, getFilePath, getHtmlPageDeclaredAssetPath, htmlStaticAssetOutputName, iconOutputPath, isDeadCssUrlRef, isFromIncludeList, isHttpLike, isSpecialScheme, manifestJsonOutputTarget, manifestPageOutputTarget, normalizeManifestOutputPath, parseHtml, replaceCssUrlRefs, resolveAbsoluteFsPath, resolveHtmlRefPath, resolveStaticAttributeName, themeIconOutputPath, themeImageOutputPath, toPosixPath, utils_isUrl };
|
|
393
|
+
export { applyRewrittenStaticUrl, cleanAssetUrl, cleanLeading, getAssetsFromHtml, getBaseHref, getBaseNode, getExtname, getFilePath, getHtmlPageDeclaredAssetPath, htmlStaticAssetOutputName, iconOutputPath, isFromIncludeList, isHttpLike, isSpecialScheme, manifestJsonOutputTarget, manifestPageOutputTarget, normalizeManifestOutputPath, parseHtml, resolveAbsoluteFsPath, resolveHtmlRefPath, resolveStaticAttributeName, themeIconOutputPath, themeImageOutputPath, utils_isUrl };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createRequire as __extjsCreateRequire } from "node:module"; const require = __extjsCreateRequire(import.meta.url);
|
|
2
2
|
import pintor from "pintor";
|
|
3
|
-
import { prefix } from "./
|
|
3
|
+
import { prefix } from "./852~0.mjs";
|
|
4
4
|
function importScriptsDependencyMissing(workerPath, literal, expectedPath, sourceSibling) {
|
|
5
5
|
const lines = [];
|
|
6
6
|
lines.push(`The background service worker calls importScripts('${literal}'), but the file isn't in the output.`);
|
|
@@ -21,6 +21,45 @@ function injectedFileDependencyMissing(assetName, literal, expectedPath, sourceS
|
|
|
21
21
|
lines.push(`Move the file to ${pintor.blue(expectedPath)} or ${pintor.blue('public/')} so it ships with the extension.`);
|
|
22
22
|
return lines.join('\n');
|
|
23
23
|
}
|
|
24
|
+
function injectedCompiledSourceLiteral(assetName, literal, emittedPath) {
|
|
25
|
+
const lines = [];
|
|
26
|
+
lines.push(`${assetName} injects '${literal}', but ${literal} is compiled to ${emittedPath}.`);
|
|
27
|
+
lines.push(`${pintor.gray('REQUESTED')} ${pintor.underline(literal)}`);
|
|
28
|
+
lines.push(`${pintor.gray('EMITTED')} ${pintor.underline(emittedPath)}`);
|
|
29
|
+
lines.push("The browser asks for the source path, which the output does not contain, so the injection fails at runtime.");
|
|
30
|
+
lines.push(`Inject the emitted path: ${pintor.blue(emittedPath)}.`);
|
|
31
|
+
return lines.join('\n');
|
|
32
|
+
}
|
|
33
|
+
const SPLIT_ENTRY_RECIPE_URL = 'https://extension.js.org/docs/features/rspack-configuration#share-a-module-between-entries';
|
|
34
|
+
const SPLIT_ENTRY_SURFACES = {
|
|
35
|
+
page: {
|
|
36
|
+
loads: (entryName)=>`${entryName}.html references only`,
|
|
37
|
+
effect: 'the page renders blank'
|
|
38
|
+
},
|
|
39
|
+
background: {
|
|
40
|
+
loads: ()=>'the background registration loads only',
|
|
41
|
+
effect: "the background script never starts"
|
|
42
|
+
},
|
|
43
|
+
content_script: {
|
|
44
|
+
loads: ()=>"the content_scripts declaration injects only",
|
|
45
|
+
effect: "the content script never runs on the page"
|
|
46
|
+
},
|
|
47
|
+
script: {
|
|
48
|
+
loads: ()=>'the runtime injection loads only',
|
|
49
|
+
effect: "the script never runs"
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
function entrySplitAcrossInitialFiles(entryName, surface, ownFile, extraFiles) {
|
|
53
|
+
const shape = SPLIT_ENTRY_SURFACES[surface];
|
|
54
|
+
const count = extraFiles.length + 1;
|
|
55
|
+
const lines = [];
|
|
56
|
+
lines.push(`${entryName} is split into ${count} initial files, but ${shape.loads(entryName)} ${ownFile}.`);
|
|
57
|
+
lines.push(`${pintor.gray('LOADED')} ${pintor.underline(ownFile)}`);
|
|
58
|
+
lines.push(`${pintor.gray('NOT LOADED')} ${extraFiles.map((file)=>pintor.underline(file)).join(', ')}`);
|
|
59
|
+
lines.push(`The entry waits for the other files at runtime and never runs, so ${shape.effect}.`);
|
|
60
|
+
lines.push(`Only a user-set optimization.splitChunks cache group does this. Use chunks: 'async' and import() the shared module: ${pintor.blue(SPLIT_ENTRY_RECIPE_URL)}`);
|
|
61
|
+
return lines.join('\n');
|
|
62
|
+
}
|
|
24
63
|
function fetchedFileDependencyMissing(assetName, literal, expectedPath) {
|
|
25
64
|
const lines = [];
|
|
26
65
|
lines.push(`${assetName} loads '${literal}' at runtime (fetch/XMLHttpRequest/new URL), but the file isn't in the output.`);
|
|
@@ -57,4 +96,4 @@ function reservedScriptsFolder(relPath, indicators) {
|
|
|
57
96
|
const reasons = indicators.map((r)=>`- ${pintor.gray(r)}`).join('\n');
|
|
58
97
|
return `${prefix('error')} scripts/ is a reserved folder in Extension.js.\n${pintor.gray('PATH')} ${pintor.underline(relPath)}\nEvery file under ${pintor.blue("scripts/")} is wrapped with the browser content-script mount runtime, so Node.js-only files placed here fail to parse or run.\nThis file looks Node.js-only:\n${reasons}\nRename the folder at the project root (for example ${pintor.blue('bin/')}, ${pintor.blue('tools/')}, or ${pintor.blue('tasks/')}), or move the file out of scripts/.`;
|
|
59
98
|
}
|
|
60
|
-
export { fetchedFileDependencyMissing, getURLDependencyMissing, importScriptsDependencyMissing, injectedFileDependencyMissing, reservedScriptsFolder, runtimeSetSurfaceDependencyMissing, staticImportDependencyMissing };
|
|
99
|
+
export { entrySplitAcrossInitialFiles, fetchedFileDependencyMissing, getURLDependencyMissing, importScriptsDependencyMissing, injectedCompiledSourceLiteral, injectedFileDependencyMissing, reservedScriptsFolder, runtimeSetSurfaceDependencyMissing, staticImportDependencyMissing };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createRequire as __extjsCreateRequire } from "node:module"; const require = __extjsCreateRequire(import.meta.url);
|
|
2
2
|
import pintor from "pintor";
|
|
3
|
-
import { prefix as messaging_prefix } from "./
|
|
3
|
+
import { prefix as messaging_prefix } from "./852~0.mjs";
|
|
4
4
|
function cssIntegrationsEnabled(integrations) {
|
|
5
5
|
const names = integrations.length > 0 ? integrations.join(',') : 'none';
|
|
6
6
|
return `${messaging_prefix('debug')} css integrations=${integrations.length} names=${names}`;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { createRequire as __extjsCreateRequire } from "node:module"; const require = __extjsCreateRequire(import.meta.url);
|
|
2
|
-
import { controlTokenPath, legacyControlTokenPath } from "./
|
|
3
|
-
import * as
|
|
4
|
-
import * as
|
|
5
|
-
import * as
|
|
2
|
+
import { controlTokenPath, legacyControlTokenPath } from "./950~0.mjs";
|
|
3
|
+
import * as __rspack_external_node_fs_1b05aee1 from "node:fs";
|
|
4
|
+
import * as __rspack_external_node_path_806ed179 from "node:path";
|
|
5
|
+
import * as __rspack_external_node_crypto_2e7c4b46 from "node:crypto";
|
|
6
6
|
const REFUSAL_NEEDS_HEADED_WINDOW = 'needs_headed_window';
|
|
7
7
|
const REFUSAL_NEEDS_USER_GESTURE = 'needs_user_gesture';
|
|
8
8
|
const REFUSAL_SURFACE_NOT_OPEN = 'surface_not_open';
|
|
@@ -10,7 +10,7 @@ const REFUSAL_API_UNAVAILABLE = 'api_unavailable';
|
|
|
10
10
|
const CONTROL_WS_PATH = '/extjs-control';
|
|
11
11
|
function readPersistedControlPort(filePath) {
|
|
12
12
|
try {
|
|
13
|
-
const port = parseInt(
|
|
13
|
+
const port = parseInt(__rspack_external_node_fs_1b05aee1.readFileSync(filePath, 'utf8').trim(), 10);
|
|
14
14
|
return Number.isInteger(port) && port > 0 && port < 65536 ? port : null;
|
|
15
15
|
} catch {
|
|
16
16
|
return null;
|
|
@@ -18,27 +18,27 @@ function readPersistedControlPort(filePath) {
|
|
|
18
18
|
}
|
|
19
19
|
function writePersistedControlPort(filePath, port) {
|
|
20
20
|
try {
|
|
21
|
-
|
|
21
|
+
__rspack_external_node_fs_1b05aee1.mkdirSync(__rspack_external_node_path_806ed179.dirname(filePath), {
|
|
22
22
|
recursive: true
|
|
23
23
|
});
|
|
24
|
-
|
|
24
|
+
__rspack_external_node_fs_1b05aee1.writeFileSync(filePath, `${port}\n`);
|
|
25
25
|
} catch {}
|
|
26
26
|
}
|
|
27
27
|
function writeControlToken(projectPath, browser) {
|
|
28
|
-
const token =
|
|
28
|
+
const token = __rspack_external_node_crypto_2e7c4b46.randomBytes(32).toString('hex');
|
|
29
29
|
const file = controlTokenPath(projectPath, browser);
|
|
30
|
-
|
|
30
|
+
__rspack_external_node_fs_1b05aee1.mkdirSync(__rspack_external_node_path_806ed179.dirname(file), {
|
|
31
31
|
recursive: true
|
|
32
32
|
});
|
|
33
|
-
|
|
33
|
+
__rspack_external_node_fs_1b05aee1.writeFileSync(file, token, {
|
|
34
34
|
encoding: 'utf-8',
|
|
35
35
|
mode: 384
|
|
36
36
|
});
|
|
37
37
|
try {
|
|
38
|
-
|
|
38
|
+
__rspack_external_node_fs_1b05aee1.chmodSync(file, 384);
|
|
39
39
|
} catch {}
|
|
40
40
|
try {
|
|
41
|
-
|
|
41
|
+
__rspack_external_node_fs_1b05aee1.writeFileSync(legacyControlTokenPath(projectPath), token, {
|
|
42
42
|
encoding: 'utf-8',
|
|
43
43
|
mode: 384
|
|
44
44
|
});
|
|
@@ -50,7 +50,7 @@ function readControlToken(projectPath, browser) {
|
|
|
50
50
|
controlTokenPath(projectPath, browser),
|
|
51
51
|
legacyControlTokenPath(projectPath)
|
|
52
52
|
])try {
|
|
53
|
-
const token =
|
|
53
|
+
const token = __rspack_external_node_fs_1b05aee1.readFileSync(file, 'utf-8').trim();
|
|
54
54
|
if (token.length) return token;
|
|
55
55
|
} catch {}
|
|
56
56
|
return null;
|
|
@@ -59,16 +59,16 @@ function clearControlToken(projectPath, browser) {
|
|
|
59
59
|
const file = controlTokenPath(projectPath, browser);
|
|
60
60
|
let token = null;
|
|
61
61
|
try {
|
|
62
|
-
token =
|
|
62
|
+
token = __rspack_external_node_fs_1b05aee1.readFileSync(file, 'utf-8').trim() || null;
|
|
63
63
|
} catch {}
|
|
64
64
|
try {
|
|
65
|
-
|
|
65
|
+
__rspack_external_node_fs_1b05aee1.rmSync(file, {
|
|
66
66
|
force: true
|
|
67
67
|
});
|
|
68
68
|
} catch {}
|
|
69
69
|
try {
|
|
70
70
|
const legacy = legacyControlTokenPath(projectPath);
|
|
71
|
-
if (token &&
|
|
71
|
+
if (token && __rspack_external_node_fs_1b05aee1.readFileSync(legacy, 'utf-8').trim() === token) __rspack_external_node_fs_1b05aee1.rmSync(legacy, {
|
|
72
72
|
force: true
|
|
73
73
|
});
|
|
74
74
|
} catch {}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { createRequire as __extjsCreateRequire } from "node:module"; const require = __extjsCreateRequire(import.meta.url);
|
|
2
|
-
import * as
|
|
3
|
-
import * as
|
|
2
|
+
import * as __rspack_external_node_fs_1b05aee1 from "node:fs";
|
|
3
|
+
import * as __rspack_external_node_path_806ed179 from "node:path";
|
|
4
4
|
function canonicalizeDir(dir) {
|
|
5
5
|
try {
|
|
6
|
-
return
|
|
6
|
+
return __rspack_external_node_fs_1b05aee1.realpathSync.native(dir);
|
|
7
7
|
} catch {
|
|
8
8
|
try {
|
|
9
|
-
return
|
|
9
|
+
return __rspack_external_node_fs_1b05aee1.realpathSync(dir);
|
|
10
10
|
} catch {
|
|
11
11
|
return dir;
|
|
12
12
|
}
|
|
@@ -15,14 +15,14 @@ function canonicalizeDir(dir) {
|
|
|
15
15
|
function canonicalizeResourcePath(resourcePath) {
|
|
16
16
|
if ('string' != typeof resourcePath || 0 === resourcePath.length) return resourcePath;
|
|
17
17
|
try {
|
|
18
|
-
return
|
|
18
|
+
return __rspack_external_node_path_806ed179.normalize(__rspack_external_node_path_806ed179.join(canonicalizeDir(__rspack_external_node_path_806ed179.dirname(resourcePath)), __rspack_external_node_path_806ed179.basename(resourcePath)));
|
|
19
19
|
} catch {
|
|
20
|
-
return
|
|
20
|
+
return __rspack_external_node_path_806ed179.normalize(resourcePath);
|
|
21
21
|
}
|
|
22
22
|
}
|
|
23
23
|
function toResourceKey(resourcePath) {
|
|
24
24
|
if ('string' != typeof resourcePath || 0 === resourcePath.length) return resourcePath;
|
|
25
|
-
const key = canonicalizeResourcePath(
|
|
25
|
+
const key = canonicalizeResourcePath(__rspack_external_node_path_806ed179.resolve(resourcePath));
|
|
26
26
|
if ('win32' === process.platform && /^[a-zA-Z]:/.test(key)) return key[0].toUpperCase() + key.slice(1);
|
|
27
27
|
return key;
|
|
28
28
|
}
|
|
@@ -31,8 +31,8 @@ function isResourceUnderDirs(resource, dirs) {
|
|
|
31
31
|
const candidate = canonicalizeResourcePath(resource);
|
|
32
32
|
return dirs.some((dir)=>{
|
|
33
33
|
if (candidate === dir) return true;
|
|
34
|
-
const rel =
|
|
35
|
-
return rel.length > 0 && !rel.startsWith('..') && !
|
|
34
|
+
const rel = __rspack_external_node_path_806ed179.relative(dir, candidate);
|
|
35
|
+
return rel.length > 0 && !rel.startsWith('..') && !__rspack_external_node_path_806ed179.isAbsolute(rel);
|
|
36
36
|
});
|
|
37
37
|
}
|
|
38
38
|
export { canonicalizeDir, canonicalizeResourcePath, isResourceUnderDirs, toResourceKey };
|