diff --git a/src/components/PageLinks/PageLinks.jsx b/src/components/PageLinks/PageLinks.jsx
index 6e012bac8c96..75d93e49b74b 100644
--- a/src/components/PageLinks/PageLinks.jsx
+++ b/src/components/PageLinks/PageLinks.jsx
@@ -1,5 +1,3 @@
-// eslint-disable-next-line n/prefer-node-protocol
-import Url from "url";
import PropTypes from "prop-types";
const baseURL = "https://github.com/webpack/webpack.js.org/edit/main/";
@@ -21,8 +19,7 @@ function _handlePrintClick(event) {
}
export default function PageLinks({ page = {} }) {
- // eslint-disable-next-line n/no-deprecated-api
- const editLink = page.edit || Url.resolve(baseURL, page.path);
+ const editLink = page.edit || new URL(page.path, baseURL).href;
return (
diff --git a/src/utilities/process-readme.mjs b/src/utilities/process-readme.mjs
index de07152328d1..064b7b90e690 100644
--- a/src/utilities/process-readme.mjs
+++ b/src/utilities/process-readme.mjs
@@ -1,4 +1,3 @@
-import url from "node:url";
import { excludedLoaders, excludedPlugins } from "./constants.mjs";
const beginsWithDocsDomainRegex = /^(?:https?:)\/\/webpack\.js\.org/;
@@ -40,8 +39,7 @@ function linkFixerFactory(sourceUrl) {
.replace(/raw.githubusercontent.com/, "github.com")
.replace(/master/, "blob/master");
- // eslint-disable-next-line n/no-deprecated-api
- href = url.resolve(renderedUrl, href);
+ href = new URL(href, renderedUrl).href;
}
// Modify absolute documentation links to be root relative