diff --git a/scripts/prepare.js b/scripts/prepare.js index d456d881a..f512eb4be 100644 --- a/scripts/prepare.js +++ b/scripts/prepare.js @@ -1,4 +1,5 @@ import path from 'node:path' +import process from 'node:process' import fs from 'fs-extra' import { icons } from '@iconify-json/ep' diff --git a/vite.config.ts b/vite.config.ts index a6db6f14f..9998f056f 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -1,5 +1,6 @@ import fs from 'node:fs' import path from 'node:path' +import process from 'node:process' import { defineConfig, loadEnv } from 'vite' import dayjs from 'dayjs' import pkg from './package.json' @@ -11,7 +12,9 @@ export default ({ mode, command }) => { // 全局 scss 资源 const scssResources = [] fs.readdirSync('src/assets/styles/resources').forEach((dirname) => { - if (fs.statSync(`src/assets/styles/resources/${dirname}`).isFile()) { scssResources.push(`@use "src/assets/styles/resources/${dirname}" as *;`) } + if (fs.statSync(`src/assets/styles/resources/${dirname}`).isFile()) { + scssResources.push(`@use "src/assets/styles/resources/${dirname}" as *;`) + } }) // css 精灵图相关 fs.readdirSync('src/assets/sprites').forEach((dirname) => { diff --git a/vite/plugins/svg-icon.ts b/vite/plugins/svg-icon.ts index 99595fe07..f76753d49 100644 --- a/vite/plugins/svg-icon.ts +++ b/vite/plugins/svg-icon.ts @@ -1,4 +1,5 @@ import path from 'node:path' +import process from 'node:process' import { createSvgIconsPlugin } from 'vite-plugin-svg-icons' export default function createSvgIcon(isBuild) {