浏览代码

fix: fix icon generation error on Windows platform (#16254)

tags/1.2.0
David 7 个月前
父节点
当前提交
40cadab8a6
没有帐户链接到提交者的电子邮件
共有 1 个文件被更改,包括 3 次插入2 次删除
  1. 3
    2
      web/app/components/base/icons/script.mjs

+ 3
- 2
web/app/components/base/icons/script.mjs 查看文件

@@ -1,9 +1,10 @@
import path from 'node:path'
import { access, appendFile, mkdir, open, readdir, rm, writeFile } from 'node:fs/promises'
import { fileURLToPath } from 'node:url'
import { parseXml } from '@rgrove/parse-xml'
import { camelCase, template } from 'lodash-es'

const __dirname = path.dirname(new URL(import.meta.url).pathname)
const __dirname = path.dirname(fileURLToPath(import.meta.url))

const generateDir = async (currentPath) => {
try {
@@ -105,7 +106,7 @@ const generateImageComponent = async (entry, pathList) => {
}
`.trim())

await writeFile(path.resolve(currentPath, `${fileName}.module.css`), `${componentCSSRender({ assetPath: path.join('~@/app/components/base/icons/assets', ...pathList.slice(2), entry) })}\n`)
await writeFile(path.resolve(currentPath, `${fileName}.module.css`), `${componentCSSRender({ assetPath: path.posix.join('~@/app/components/base/icons/assets', ...pathList.slice(2), entry) })}\n`)

const componentRender = template(`
// GENERATE BY script

正在加载...
取消
保存