222
schangxiang@126.com
2025-04-30 9bec4dcae002f36aa23231da11cb03a156b40110
PipeLineLems/web/script/plugins/vite-plugin-widget-provider.ts
@@ -5,6 +5,7 @@
// @ts-ignore
const filePath = isWin ? basePath.replaceAll('\\', '/') : basePath
const regex = new RegExp(`${filePath}/([^/]*)/index.ts`)
const NOT_PAGE = 'notPage:true'
/**
 * 提取关键字符
 * @param {*} code
@@ -58,8 +59,12 @@
        if (regex.test(id)) {
          const codeData = parseCode(code)
          const transformCode = mergeCodeString(codeData, code)
          // const emptyCode = code.replaceAll(' ', '')
          const newCode = transformCode
          // const newCode = emptyCode.includes(NOT_PAGE) ? code : transformCode
          return {
            code: transformCode,
            code: newCode,
            map: null, // 如果可行将提供 source map
          }
        }