Skip to content

Commit 656a4ae

Browse files
authoredMar 16, 2022
Remove use of URL from url
Reviewed-by: Titus Wormer <tituswormer@gmail.com> Closes GH-1976.
1 parent 2886021 commit 656a4ae

File tree

7 files changed

+6
-11
lines changed

7 files changed

+6
-11
lines changed
 

‎packages/esbuild/lib/index.js

-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
* @typedef {ProcessorOptions & {allowDangerousRemoteMdx?: boolean}} Options
1414
*/
1515

16-
import {URL} from 'url'
1716
import assert from 'node:assert'
1817
import {promises as fs} from 'node:fs'
1918
import path from 'node:path'

‎packages/esbuild/test/index.test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
*/
1010

1111
import {promises as fs} from 'fs'
12-
import {URL, fileURLToPath} from 'url'
12+
import {fileURLToPath} from 'url'
1313
import {test} from 'uvu'
1414
import * as assert from 'uvu/assert'
1515
import esbuild from 'esbuild'

‎packages/loader/test/index.test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
import {promises as fs} from 'fs'
99
import {promisify} from 'util'
10-
import {URL, fileURLToPath} from 'url'
10+
import {fileURLToPath} from 'url'
1111
import {test} from 'uvu'
1212
import * as assert from 'uvu/assert'
1313
import webpack from 'webpack'

‎packages/mdx/lib/plugin/recma-document.js

-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@
3939
* JSX runtime to use.
4040
*/
4141

42-
import {URL} from 'url'
4342
import {analyze} from 'periscopic'
4443
import {stringifyPosition} from 'unist-util-stringify-position'
4544
import {positionFromEstree} from 'unist-util-position-from-estree'

‎packages/node-loader/test/index.test.js

-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
*/
44

55
import {promises as fs} from 'fs'
6-
import {URL} from 'url'
76
import {test} from 'uvu'
87
import * as assert from 'uvu/assert'
98
import React from 'react'

‎packages/rollup/test/index.test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*/
44

55
import {promises as fs} from 'fs'
6-
import {URL, fileURLToPath} from 'url'
6+
import {fileURLToPath} from 'url'
77
import {test} from 'uvu'
88
import * as assert from 'uvu/assert'
99
import {rollup} from 'rollup'

‎website/bundle.js

+3-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/usr/bin/env node
2-
import url from 'url'
2+
import {fileURLToPath} from 'url'
33
import process from 'process'
44
import webpack from 'webpack'
55
import ReactServerWebpackPlugin from 'react-server-dom-webpack/plugin'
@@ -13,17 +13,15 @@ webpack(
1313
mode: production ? 'production' : 'development',
1414
devtool: production ? 'source-map' : 'cheap-module-source-map',
1515
entry: [
16-
url.fileURLToPath(
17-
new URL('../docs/_asset/index.client.js', import.meta.url)
18-
)
16+
fileURLToPath(new URL('../docs/_asset/index.client.js', import.meta.url))
1917
],
2018
output: {
2119
// RSC puts all chunks in `public/` (perhaps due to my weird doing),
2220
// but on a page `public/folder/index.html`, RSC/WP will then load
2321
// `public/folder/chunk.js`, even though it’s at `public/chunk.js`.
2422
// This fixes that!
2523
publicPath: '/',
26-
path: url.fileURLToPath(config.output),
24+
path: fileURLToPath(config.output),
2725
filename: 'index.js'
2826
},
2927
module: {

1 commit comments

Comments
 (1)

vercel[bot] commented on Mar 16, 2022

@vercel[bot]

Successfully deployed to the following URLs:

Please sign in to comment.