]> git.ipfire.org Git - thirdparty/vuejs/router.git/commitdiff
chore: build path compatibility with nodejs v20 (#2464)
authorSpaceman <chenjunwei517@qq.com>
Mon, 14 Apr 2025 07:29:21 +0000 (15:29 +0800)
committerGitHub <noreply@github.com>
Mon, 14 Apr 2025 07:29:21 +0000 (09:29 +0200)
packages/docs/run-typedoc.mjs
packages/docs/typedoc-markdown.mjs
packages/router/size-checks/rollup.config.mjs
scripts/check-size.mjs

index e69935587dd6fe2bbc0e0f46a53b91128bdb31c6..790b14b9a6affdd34863cea4879af4410b3317d0 100644 (file)
@@ -1,7 +1,8 @@
 import path from 'node:path'
+import { fileURLToPath } from 'node:url'
 import { createTypeDocApp } from './typedoc-markdown.mjs'
 
-const __dirname = path.dirname(new URL(import.meta.url).pathname)
+const __dirname = path.dirname(fileURLToPath(import.meta.url))
 
 createTypeDocApp({
   name: 'API Documentation',
index 90513b832e9d366421e61cb896f18f7ec8fd9503..02cd0ae065e3f96653dd392e29a8ed301eed9de4 100644 (file)
@@ -1,9 +1,10 @@
 // @ts-check
 import fs from 'node:fs/promises'
 import path from 'node:path'
+import {fileURLToPath} from 'node:url'
 import { Application, PageEvent, TSConfigReader } from 'typedoc'
 
-const __dirname = path.dirname(new URL(import.meta.url).pathname)
+const __dirname = path.dirname(fileURLToPath(import.meta.url))
 
 const DEFAULT_OPTIONS = {
   // disableOutputCheck: true,
index 9b3f070719149d7af9ea242d5f0963e874d7337b..73485959acb4f3c2750144c2b3d542dc2ffcb4f0 100644 (file)
@@ -1,4 +1,5 @@
 import path from 'node:path'
+import {fileURLToPath} from 'node:url'
 import ts from 'rollup-plugin-typescript2'
 import replace from '@rollup/plugin-replace'
 import resolve from '@rollup/plugin-node-resolve'
@@ -6,7 +7,7 @@ import commonjs from '@rollup/plugin-commonjs'
 import terser from '@rollup/plugin-terser'
 import { defineConfig } from 'rollup'
 
-const __dirname = path.dirname(new URL(import.meta.url).pathname)
+const __dirname = path.dirname(fileURLToPath(import.meta.url))
 
 const config = defineConfig({
   external: ['vue'],
index 59a5bbc8de252706f6c5f5c8a067851fd8d3678f..22d62db7d19d354402796352fb38ac6b53bb74e9 100644 (file)
@@ -1,10 +1,11 @@
 import fs from 'node:fs/promises'
 import path from 'node:path'
+import {fileURLToPath} from 'node:url'
 import chalk from 'chalk'
 import { gzipSync } from 'zlib'
 import { compress } from 'brotli'
 
-const __dirname = path.dirname(new URL(import.meta.url).pathname)
+const __dirname = path.dirname(fileURLToPath(import.meta.url))
 
 async function checkFileSize(filePath) {
   const stat = await fs.stat(filePath).catch(() => null)