chore: add prefix of node core modules (#11440)

This commit is contained in:
neverland
2022-12-31 20:27:35 +08:00
committed by GitHub
parent 65d6a22f03
commit 5bd6997d3c
27 changed files with 43 additions and 43 deletions
@@ -1,6 +1,6 @@
import less from 'less';
import { join } from 'path';
import { readFileSync } from 'fs';
import { join } from 'node:path';
import { readFileSync } from 'node:fs';
import { CWD } from '../common/constant.js';
export async function compileLess(filePath: string) {
@@ -1,4 +1,4 @@
import { createRequire } from 'module';
import { createRequire } from 'node:module';
const require = createRequire(import.meta.url);
@@ -1,7 +1,7 @@
import fse from 'fs-extra';
import babel from '@babel/core';
import esbuild, { type Format } from 'esbuild';
import { sep } from 'path';
import { sep } from 'node:path';
import { isJsx, replaceExt, getVantConfig } from '../common/index.js';
import { replaceCSSImportExt } from '../common/css.js';
import { replaceScriptImportExt } from './get-deps.js';
@@ -1,5 +1,5 @@
import fse from 'fs-extra';
import path from 'path';
import path from 'node:path';
import hash from 'hash-sum';
import {
parse,
@@ -1,5 +1,5 @@
import color from 'picocolors';
import { createRequire } from 'module';
import { createRequire } from 'node:module';
import { createServer, build } from 'vite';
import {
getViteConfigForSiteDev,
@@ -1,4 +1,4 @@
import { parse } from 'path';
import { parse } from 'node:path';
import fse from 'fs-extra';
import { getVantConfig, replaceExt } from '../common/index.js';
import { compileCss } from './compile-css.js';
@@ -3,8 +3,8 @@
*/
import fse from 'fs-extra';
import { createRequire } from 'module';
import { sep, join, relative } from 'path';
import { createRequire } from 'node:module';
import { sep, join, relative } from 'node:path';
import { getComponents, replaceExt } from '../common/index.js';
import { CSS_LANG, getCssBaseFile } from '../common/css.js';
import { checkStyleExists } from './gen-style-deps-map.js';
@@ -1,4 +1,4 @@
import { join } from 'path';
import { join } from 'node:path';
import {
pascalize,
getComponents,
@@ -1,6 +1,6 @@
import { join } from 'path';
import { existsSync } from 'fs';
import { createRequire } from 'module';
import { join } from 'node:path';
import { existsSync } from 'node:fs';
import { createRequire } from 'node:module';
import { smartOutputFile, normalizePath } from '../common/index.js';
import { CSS_LANG, getCssBaseFile } from '../common/css.js';
import { SRC_DIR, STYLE_DEPS_JSON_FILE } from '../common/constant.js';
@@ -1,6 +1,6 @@
import glob from 'fast-glob';
import { join, parse } from 'path';
import { existsSync, readFileSync, readdirSync } from 'fs';
import { join, parse } from 'node:path';
import { existsSync, readFileSync, readdirSync } from 'node:fs';
import { pascalize, getVantConfig, normalizePath } from '../common/index.js';
import {
SRC_DIR,
@@ -1,5 +1,5 @@
import { join } from 'path';
import { existsSync, readdirSync } from 'fs';
import { join } from 'node:path';
import { existsSync, readdirSync } from 'node:fs';
import { SRC_DIR } from '../common/constant.js';
import {
pascalize,
@@ -1,6 +1,6 @@
import { relative, sep, join } from 'path';
import { relative, sep, join } from 'node:path';
import { CSS_LANG } from '../common/css.js';
import { existsSync } from 'fs';
import { existsSync } from 'node:fs';
import { getDeps, clearDepsCache, fillExt } from './get-deps.js';
import { getComponents, smartOutputFile } from '../common/index.js';
import { SRC_DIR, STYLE_DEPS_JSON_FILE } from '../common/constant.js';
+2 -2
View File
@@ -1,6 +1,6 @@
import { join } from 'path';
import { join } from 'node:path';
import { SCRIPT_EXTS, STYLE_EXTS } from '../common/constant.js';
import { readFileSync, existsSync } from 'fs';
import { readFileSync, existsSync } from 'node:fs';
let depsMap: Record<string, string[]> = {};
let existsCache: Record<string, boolean> = {};
@@ -1,5 +1,5 @@
import glob from 'fast-glob';
import { join } from 'path';
import { join } from 'node:path';
import fse from 'fs-extra';
import { mdParser } from './parser.js';
import { formatter } from './formatter.js';
@@ -1,4 +1,4 @@
import { PathLike } from 'fs';
import { PathLike } from 'node:fs';
export type VueSlot = {
name: string;