Skip to content

Commit 30b0679

Browse files
committed
Replace paths with URLs
1 parent d0c8e88 commit 30b0679

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

script/generate-jsx.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
import fs from 'node:fs/promises'
2-
import path from 'node:path'
32
import acornJsx from 'acorn-jsx'
43
import {fromJs} from 'esast-util-from-js'
54
import {toJs} from 'estree-util-to-js'
65
import {buildJsx} from 'estree-util-build-jsx'
76

8-
const doc = String(await fs.readFile(path.join('test', 'jsx.jsx')))
7+
const doc = String(
8+
await fs.readFile(new URL('../test/jsx.jsx', import.meta.url))
9+
)
910

1011
await fs.writeFile(
11-
path.join('test', 'jsx-build-jsx-classic.js'),
12+
new URL('../test/jsx-build-jsx-classic.js', import.meta.url),
1213
toJs(
1314
buildJsx(
1415
fromJs(doc.replace(/'name'/, "'jsx (estree-util-build-jsx, classic)'"), {
@@ -21,7 +22,7 @@ await fs.writeFile(
2122
)
2223

2324
await fs.writeFile(
24-
path.join('test', 'jsx-build-jsx-automatic.js'),
25+
new URL('../test/jsx-build-jsx-automatic.js', import.meta.url),
2526
toJs(
2627
buildJsx(
2728
fromJs(
@@ -34,7 +35,7 @@ await fs.writeFile(
3435
)
3536

3637
await fs.writeFile(
37-
path.join('test', 'jsx-build-jsx-automatic-development.js'),
38+
new URL('../test/jsx-build-jsx-automatic-development.js', import.meta.url),
3839
toJs(
3940
buildJsx(
4041
fromJs(

0 commit comments

Comments
 (0)