From 2bbf21d1053d8fcd3edcb0a8c79db9482873682d Mon Sep 17 00:00:00 2001 From: Hooray Hu <304327508@qq.com> Date: Sat, 26 Aug 2023 12:18:40 +0800 Subject: [PATCH] =?UTF-8?q?chore:=20=E8=A1=A5=E5=85=85=20process=20?= =?UTF-8?q?=E5=BC=95=E5=85=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/prepare.js | 1 + vite.config.ts | 5 ++++- vite/plugins/svg-icon.ts | 1 + 3 files changed, 6 insertions(+), 1 deletion(-) 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) {