Skip to content

Commit 60721ac

Browse files
Shinigami92bluwy
andauthored
chore: use node prefix (#8309)
Co-authored-by: bluwy <bjornlu.dev@gmail.com>
1 parent 8a05432 commit 60721ac

File tree

128 files changed

+252
-244
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

128 files changed

+252
-244
lines changed

packages/create-vite/__tests__/cli.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { join } from 'path'
1+
import { join } from 'node:path'
22
import type { ExecaSyncReturnValue, SyncOptions } from 'execa'
33
import { execaCommandSync } from 'execa'
44
import { mkdirpSync, readdirSync, remove, writeFileSync } from 'fs-extra'

packages/create-vite/index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
#!/usr/bin/env node
22

33
// @ts-check
4-
import fs from 'fs'
5-
import path from 'path'
6-
import { fileURLToPath } from 'url'
4+
import fs from 'node:fs'
5+
import path from 'node:path'
6+
import { fileURLToPath } from 'node:url'
77
import minimist from 'minimist'
88
import prompts from 'prompts'
99
import {

packages/plugin-legacy/src/index.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
/* eslint-disable node/no-extraneous-import */
2-
import path from 'path'
3-
import { createHash } from 'crypto'
4-
import { createRequire } from 'module'
5-
import { fileURLToPath } from 'url'
2+
import path from 'node:path'
3+
import { createHash } from 'node:crypto'
4+
import { createRequire } from 'node:module'
5+
import { fileURLToPath } from 'node:url'
66
import { build } from 'vite'
77
import MagicString from 'magic-string'
88
import type {

packages/plugin-react/src/fast-refresh.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import fs from 'fs'
2-
import path from 'path'
3-
import { createRequire } from 'module'
1+
import fs from 'node:fs'
2+
import path from 'node:path'
3+
import { createRequire } from 'node:module'
44
import type { types as t } from '@babel/core'
55

66
export const runtimePublicPath = '/@react-refresh'

packages/plugin-react/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import path from 'path'
1+
import path from 'node:path'
22
import type { ParserOptions, TransformOptions, types as t } from '@babel/core'
33
import * as babel from '@babel/core'
44
import { createFilter, normalizePath } from 'vite'

packages/plugin-vue-jsx/src/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { createHash } from 'crypto'
2-
import path from 'path'
1+
import { createHash } from 'node:crypto'
2+
import path from 'node:path'
33
import type { types } from '@babel/core'
44
import * as babel from '@babel/core'
55
import jsx from '@vue/babel-plugin-jsx'

packages/plugin-vue/src/compiler.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ declare module 'vue/compiler-sfc' {
55
}
66
}
77

8-
import { createRequire } from 'module'
8+
import { createRequire } from 'node:module'
99
import type * as _compiler from 'vue/compiler-sfc'
1010

1111
export function resolveCompiler(root: string): typeof _compiler {

packages/plugin-vue/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import fs from 'fs'
1+
import fs from 'node:fs'
22
import type { Plugin, ViteDevServer } from 'vite'
33
import { createFilter } from 'vite'
44
/* eslint-disable import/no-duplicates */

packages/plugin-vue/src/main.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import path from 'path'
1+
import path from 'node:path'
22
import type { SFCBlock, SFCDescriptor } from 'vue/compiler-sfc'
33
import type { PluginContext, TransformPluginContext } from 'rollup'
44
import type { RawSourceMap } from 'source-map'

packages/plugin-vue/src/template.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import path from 'path'
1+
import path from 'node:path'
22
import slash from 'slash'
33
import type {
44
CompilerOptions,

0 commit comments

Comments
 (0)