extension-develop 4.1.15 → 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/{86.mjs → 273~0.mjs} +7 -7
- package/dist/{834.mjs → 300~0.mjs} +43 -43
- package/dist/{266.mjs → 519~0.mjs} +1 -1
- 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 -9
- package/dist/{101.mjs → 832~0.mjs} +113 -113
- package/dist/{839.mjs → 840~0.mjs} +96 -96
- package/dist/{129.mjs → 88~0.mjs} +8 -8
- package/dist/{77.mjs → 950~0.mjs} +104 -104
- 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} +43 -43
- 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/pages/centralized-logger.js +4 -4
- package/dist/extension-js-devtools/chrome/shared/commons.js +1 -1
- 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/pages/centralized-logger.js +4 -4
- package/dist/extension-js-devtools/chromium/shared/commons.js +1 -1
- 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/pages/centralized-logger.js +4 -4
- package/dist/extension-js-devtools/edge/shared/commons.js +1 -1
- 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/pages/centralized-logger.js +4 -4
- package/dist/extension-js-devtools/firefox/shared/commons.js +1 -1
- 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 +2 -2
- 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/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 +4 -4
- 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/patch-html.d.ts +1 -1
- 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 +1 -1
- 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/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/warn-split-initial-chunks.d.ts +1 -1
- 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/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 +1 -36
- package/dist/rspack-config.d.ts +2 -2
- package/dist/{0~rspack-config.mjs → rspack-config~0.mjs} +731 -606
- 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 };
|
|
@@ -1,10 +1,10 @@
|
|
|
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
|
const ASSET_EXT = /\.(png|jpe?g|gif|webp|svg|avif|ico|bmp|cur|woff2?|ttf|otf|eot|mp3|mp4|webm|ogg|wav)$/i;
|
|
5
5
|
const URL_REF = /url\(\s*(?:"([^"\n]*)"|'([^'\n]*)'|([^)'"\s]*))\s*\)/g;
|
|
6
6
|
function toPosixPath(value) {
|
|
7
|
-
return String(value).split(
|
|
7
|
+
return String(value).split(__rspack_external_node_path_806ed179.sep).join('/');
|
|
8
8
|
}
|
|
9
9
|
function isDeadCssUrlRef(rawRequest, { issuerDir, roots }) {
|
|
10
10
|
const req = String(rawRequest).split('?')[0].split('#')[0];
|
|
@@ -14,11 +14,11 @@ function isDeadCssUrlRef(rawRequest, { issuerDir, roots }) {
|
|
|
14
14
|
const isRelativeRef = req.startsWith('./') || req.startsWith('../');
|
|
15
15
|
const isBareAssetRef = !isRootRef && !isRelativeRef && ASSET_EXT.test(req);
|
|
16
16
|
if (!isRootRef && !isRelativeRef && !isBareAssetRef) return false;
|
|
17
|
-
const candidates = isRootRef ? roots.map((root)=>
|
|
18
|
-
|
|
19
|
-
...isBareAssetRef ? roots.map((root)=>
|
|
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
20
|
];
|
|
21
|
-
return !candidates.some((candidate)=>
|
|
21
|
+
return !candidates.some((candidate)=>__rspack_external_node_fs_1b05aee1.existsSync(candidate));
|
|
22
22
|
}
|
|
23
23
|
function replaceCssUrlRefs(source, replacer) {
|
|
24
24
|
return source.replace(URL_REF, (whole, dq, sq, bare)=>{
|
|
@@ -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) {
|
|
@@ -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.`);
|
|
@@ -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 };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createRequire as __extjsCreateRequire } from "node:module"; const require = __extjsCreateRequire(import.meta.url);
|
|
2
|
-
import { stripBom } from "./
|
|
3
|
-
import * as
|
|
4
|
-
import * as
|
|
2
|
+
import { stripBom } from "./374~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
5
|
const PROJECT_MANIFEST_FILENAMES = [
|
|
6
6
|
'package.json',
|
|
7
7
|
'deno.jsonc',
|
|
@@ -102,9 +102,9 @@ function parseNpmSpecifier(specifier) {
|
|
|
102
102
|
}
|
|
103
103
|
function findDenoConfigPath(projectDir) {
|
|
104
104
|
for (const filename of DENO_CONFIG_FILENAMES){
|
|
105
|
-
const candidate =
|
|
105
|
+
const candidate = __rspack_external_node_path_806ed179.join(projectDir, filename);
|
|
106
106
|
try {
|
|
107
|
-
if (
|
|
107
|
+
if (__rspack_external_node_fs_1b05aee1.statSync(candidate).isFile()) return candidate;
|
|
108
108
|
} catch {}
|
|
109
109
|
}
|
|
110
110
|
}
|
|
@@ -112,7 +112,7 @@ function readDenoConfigDependencies(denoConfigPath) {
|
|
|
112
112
|
const dependencies = {};
|
|
113
113
|
let config;
|
|
114
114
|
try {
|
|
115
|
-
config = parseJsoncSafe(
|
|
115
|
+
config = parseJsoncSafe(__rspack_external_node_fs_1b05aee1.readFileSync(denoConfigPath, 'utf8'));
|
|
116
116
|
} catch {
|
|
117
117
|
return dependencies;
|
|
118
118
|
}
|
|
@@ -129,7 +129,7 @@ function readDenoConfigDependencies(denoConfigPath) {
|
|
|
129
129
|
}
|
|
130
130
|
function readPackageJsonDependencies(packageJsonPath) {
|
|
131
131
|
try {
|
|
132
|
-
const pkg = JSON.parse(stripBom(
|
|
132
|
+
const pkg = JSON.parse(stripBom(__rspack_external_node_fs_1b05aee1.readFileSync(packageJsonPath, 'utf8')) || '{}');
|
|
133
133
|
const sections = [
|
|
134
134
|
pkg.dependencies,
|
|
135
135
|
pkg.devDependencies,
|
|
@@ -148,7 +148,7 @@ function readPackageJsonDependencies(packageJsonPath) {
|
|
|
148
148
|
function readProjectDependencies(projectDir) {
|
|
149
149
|
const denoConfigPath = findDenoConfigPath(projectDir);
|
|
150
150
|
const denoDependencies = denoConfigPath ? readDenoConfigDependencies(denoConfigPath) : {};
|
|
151
|
-
const packageJsonDependencies = readPackageJsonDependencies(
|
|
151
|
+
const packageJsonDependencies = readPackageJsonDependencies(__rspack_external_node_path_806ed179.join(projectDir, 'package.json'));
|
|
152
152
|
return {
|
|
153
153
|
...denoDependencies,
|
|
154
154
|
...packageJsonDependencies
|
|
@@ -160,42 +160,42 @@ function hasProjectDependency(projectDir, packageName) {
|
|
|
160
160
|
function findNearestProjectManifestDirSync(startPath, maxDepth = 6) {
|
|
161
161
|
let currentDirectory = startPath;
|
|
162
162
|
for(let i = 0; i < maxDepth; i++){
|
|
163
|
-
if (PROJECT_MANIFEST_FILENAMES.some((filename)=>
|
|
164
|
-
const parentDirectory =
|
|
163
|
+
if (PROJECT_MANIFEST_FILENAMES.some((filename)=>__rspack_external_node_fs_1b05aee1.existsSync(__rspack_external_node_path_806ed179.join(currentDirectory, filename)))) return currentDirectory;
|
|
164
|
+
const parentDirectory = __rspack_external_node_path_806ed179.dirname(currentDirectory);
|
|
165
165
|
if (parentDirectory === currentDirectory) break;
|
|
166
166
|
currentDirectory = parentDirectory;
|
|
167
167
|
}
|
|
168
168
|
}
|
|
169
169
|
function findNearestProjectManifestSync(manifestPath) {
|
|
170
|
-
const root =
|
|
171
|
-
let currentDir =
|
|
170
|
+
const root = __rspack_external_node_path_806ed179.parse(manifestPath).root;
|
|
171
|
+
let currentDir = __rspack_external_node_path_806ed179.dirname(manifestPath);
|
|
172
172
|
while(true){
|
|
173
173
|
for (const filename of PROJECT_MANIFEST_FILENAMES){
|
|
174
|
-
const candidate =
|
|
174
|
+
const candidate = __rspack_external_node_path_806ed179.join(currentDir, filename);
|
|
175
175
|
try {
|
|
176
|
-
if (
|
|
176
|
+
if (__rspack_external_node_fs_1b05aee1.statSync(candidate).isFile()) return candidate;
|
|
177
177
|
} catch {}
|
|
178
178
|
}
|
|
179
179
|
if (currentDir === root) return null;
|
|
180
|
-
currentDir =
|
|
180
|
+
currentDir = __rspack_external_node_path_806ed179.dirname(currentDir);
|
|
181
181
|
}
|
|
182
182
|
}
|
|
183
183
|
function findNearestDenoConfigSync(manifestPath) {
|
|
184
184
|
if (/^(?:\.[\\/])?[a-z][a-z0-9+.-]+:[\\/]+/i.test(manifestPath)) return null;
|
|
185
|
-
const root =
|
|
186
|
-
let currentDir =
|
|
185
|
+
const root = __rspack_external_node_path_806ed179.parse(__rspack_external_node_path_806ed179.resolve(manifestPath)).root;
|
|
186
|
+
let currentDir = __rspack_external_node_path_806ed179.dirname(__rspack_external_node_path_806ed179.resolve(manifestPath));
|
|
187
187
|
while(true){
|
|
188
188
|
const found = findDenoConfigPath(currentDir);
|
|
189
189
|
if (found) return found;
|
|
190
|
-
const parentDir =
|
|
190
|
+
const parentDir = __rspack_external_node_path_806ed179.dirname(currentDir);
|
|
191
191
|
if (currentDir === root || parentDir === currentDir) return null;
|
|
192
192
|
currentDir = parentDir;
|
|
193
193
|
}
|
|
194
194
|
}
|
|
195
195
|
function validateDenoConfig(denoConfigPath) {
|
|
196
196
|
try {
|
|
197
|
-
if (!
|
|
198
|
-
parseJsoncSafe(
|
|
197
|
+
if (!__rspack_external_node_fs_1b05aee1.existsSync(denoConfigPath)) return false;
|
|
198
|
+
parseJsoncSafe(__rspack_external_node_fs_1b05aee1.readFileSync(denoConfigPath, 'utf8'));
|
|
199
199
|
return true;
|
|
200
200
|
} catch {
|
|
201
201
|
return false;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { createRequire as __extjsCreateRequire } from "node:module"; const require = __extjsCreateRequire(import.meta.url);
|
|
2
|
-
import { htmlStaticAssetOutputName } from "./
|
|
3
|
-
import { replaceCssUrlRefs, toPosixPath } from "./
|
|
4
|
-
import * as
|
|
5
|
-
import * as
|
|
2
|
+
import { htmlStaticAssetOutputName } from "./300~0.mjs";
|
|
3
|
+
import { replaceCssUrlRefs, toPosixPath } 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
6
|
const EXTENSION_ROOT_PLACEHOLDER = '__EXTENSIONJS_EXTENSION_ROOT__/';
|
|
7
7
|
function isFile(candidate) {
|
|
8
8
|
try {
|
|
9
|
-
return
|
|
9
|
+
return __rspack_external_node_fs_1b05aee1.statSync(candidate).isFile();
|
|
10
10
|
} catch {
|
|
11
11
|
return false;
|
|
12
12
|
}
|
|
@@ -14,13 +14,13 @@ function isFile(candidate) {
|
|
|
14
14
|
function resolveTarget(req, { resourcePath, manifestDir, publicRoot }) {
|
|
15
15
|
if (req.startsWith('/')) {
|
|
16
16
|
const rel = req.slice(1);
|
|
17
|
-
const fromPublic =
|
|
17
|
+
const fromPublic = __rspack_external_node_path_806ed179.join(publicRoot, rel);
|
|
18
18
|
if (isFile(fromPublic)) return {
|
|
19
19
|
absolutePath: fromPublic,
|
|
20
|
-
outputName: toPosixPath(
|
|
20
|
+
outputName: toPosixPath(__rspack_external_node_path_806ed179.normalize(rel)),
|
|
21
21
|
publicOwned: true
|
|
22
22
|
};
|
|
23
|
-
const fromManifest =
|
|
23
|
+
const fromManifest = __rspack_external_node_path_806ed179.join(manifestDir, rel);
|
|
24
24
|
if (!isFile(fromManifest)) return;
|
|
25
25
|
return {
|
|
26
26
|
absolutePath: fromManifest,
|
|
@@ -28,7 +28,7 @@ function resolveTarget(req, { resourcePath, manifestDir, publicRoot }) {
|
|
|
28
28
|
publicOwned: false
|
|
29
29
|
};
|
|
30
30
|
}
|
|
31
|
-
const absolutePath =
|
|
31
|
+
const absolutePath = __rspack_external_node_path_806ed179.resolve(__rspack_external_node_path_806ed179.dirname(resourcePath), req);
|
|
32
32
|
if (!isFile(absolutePath)) return;
|
|
33
33
|
return {
|
|
34
34
|
absolutePath,
|