Skip to content

Commit 4c8a83f

Browse files
authored
chore: build path compatibility with nodejs v20 (#2464)
1 parent 707608e commit 4c8a83f

File tree

4 files changed

+8
-4
lines changed

4 files changed

+8
-4
lines changed

packages/docs/run-typedoc.mjs

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import path from 'node:path'
2+
import { fileURLToPath } from 'node:url'
23
import { createTypeDocApp } from './typedoc-markdown.mjs'
34

4-
const __dirname = path.dirname(new URL(import.meta.url).pathname)
5+
const __dirname = path.dirname(fileURLToPath(import.meta.url))
56

67
createTypeDocApp({
78
name: 'API Documentation',

packages/docs/typedoc-markdown.mjs

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
// @ts-check
22
import fs from 'node:fs/promises'
33
import path from 'node:path'
4+
import {fileURLToPath} from 'node:url'
45
import { Application, PageEvent, TSConfigReader } from 'typedoc'
56

6-
const __dirname = path.dirname(new URL(import.meta.url).pathname)
7+
const __dirname = path.dirname(fileURLToPath(import.meta.url))
78

89
const DEFAULT_OPTIONS = {
910
// disableOutputCheck: true,

packages/router/size-checks/rollup.config.mjs

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
import path from 'node:path'
2+
import {fileURLToPath} from 'node:url'
23
import ts from 'rollup-plugin-typescript2'
34
import replace from '@rollup/plugin-replace'
45
import resolve from '@rollup/plugin-node-resolve'
56
import commonjs from '@rollup/plugin-commonjs'
67
import terser from '@rollup/plugin-terser'
78
import { defineConfig } from 'rollup'
89

9-
const __dirname = path.dirname(new URL(import.meta.url).pathname)
10+
const __dirname = path.dirname(fileURLToPath(import.meta.url))
1011

1112
const config = defineConfig({
1213
external: ['vue'],

scripts/check-size.mjs

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
import fs from 'node:fs/promises'
22
import path from 'node:path'
3+
import {fileURLToPath} from 'node:url'
34
import chalk from 'chalk'
45
import { gzipSync } from 'zlib'
56
import { compress } from 'brotli'
67

7-
const __dirname = path.dirname(new URL(import.meta.url).pathname)
8+
const __dirname = path.dirname(fileURLToPath(import.meta.url))
89

910
async function checkFileSize(filePath) {
1011
const stat = await fs.stat(filePath).catch(() => null)

0 commit comments

Comments
 (0)