Skip to content

Commit

Permalink
Remove use of URL from url
Browse files Browse the repository at this point in the history
Reviewed-by: Titus Wormer <tituswormer@gmail.com>

Closes GH-1976.
  • Loading branch information
zfben committed Mar 16, 2022
1 parent 2886021 commit 656a4ae
Show file tree
Hide file tree
Showing 7 changed files with 6 additions and 11 deletions.
1 change: 0 additions & 1 deletion packages/esbuild/lib/index.js
Expand Up @@ -13,7 +13,6 @@
* @typedef {ProcessorOptions & {allowDangerousRemoteMdx?: boolean}} Options
*/

import {URL} from 'url'
import assert from 'node:assert'
import {promises as fs} from 'node:fs'
import path from 'node:path'
Expand Down
2 changes: 1 addition & 1 deletion packages/esbuild/test/index.test.js
Expand Up @@ -9,7 +9,7 @@
*/

import {promises as fs} from 'fs'
import {URL, fileURLToPath} from 'url'
import {fileURLToPath} from 'url'
import {test} from 'uvu'
import * as assert from 'uvu/assert'
import esbuild from 'esbuild'
Expand Down
2 changes: 1 addition & 1 deletion packages/loader/test/index.test.js
Expand Up @@ -7,7 +7,7 @@

import {promises as fs} from 'fs'
import {promisify} from 'util'
import {URL, fileURLToPath} from 'url'
import {fileURLToPath} from 'url'
import {test} from 'uvu'
import * as assert from 'uvu/assert'
import webpack from 'webpack'
Expand Down
1 change: 0 additions & 1 deletion packages/mdx/lib/plugin/recma-document.js
Expand Up @@ -39,7 +39,6 @@
* JSX runtime to use.
*/

import {URL} from 'url'
import {analyze} from 'periscopic'
import {stringifyPosition} from 'unist-util-stringify-position'
import {positionFromEstree} from 'unist-util-position-from-estree'
Expand Down
1 change: 0 additions & 1 deletion packages/node-loader/test/index.test.js
Expand Up @@ -3,7 +3,6 @@
*/

import {promises as fs} from 'fs'
import {URL} from 'url'
import {test} from 'uvu'
import * as assert from 'uvu/assert'
import React from 'react'
Expand Down
2 changes: 1 addition & 1 deletion packages/rollup/test/index.test.js
Expand Up @@ -3,7 +3,7 @@
*/

import {promises as fs} from 'fs'
import {URL, fileURLToPath} from 'url'
import {fileURLToPath} from 'url'
import {test} from 'uvu'
import * as assert from 'uvu/assert'
import {rollup} from 'rollup'
Expand Down
8 changes: 3 additions & 5 deletions website/bundle.js
@@ -1,5 +1,5 @@
#!/usr/bin/env node
import url from 'url'
import {fileURLToPath} from 'url'
import process from 'process'
import webpack from 'webpack'
import ReactServerWebpackPlugin from 'react-server-dom-webpack/plugin'
Expand All @@ -13,17 +13,15 @@ webpack(
mode: production ? 'production' : 'development',
devtool: production ? 'source-map' : 'cheap-module-source-map',
entry: [
url.fileURLToPath(
new URL('../docs/_asset/index.client.js', import.meta.url)
)
fileURLToPath(new URL('../docs/_asset/index.client.js', import.meta.url))
],
output: {
// RSC puts all chunks in `public/` (perhaps due to my weird doing),
// but on a page `public/folder/index.html`, RSC/WP will then load
// `public/folder/chunk.js`, even though it’s at `public/chunk.js`.
// This fixes that!
publicPath: '/',
path: url.fileURLToPath(config.output),
path: fileURLToPath(config.output),
filename: 'index.js'
},
module: {
Expand Down

1 comment on commit 656a4ae

@vercel
Copy link

@vercel vercel bot commented on 656a4ae Mar 16, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

Please sign in to comment.