| | |
| | | // @ts-ignore |
| | | const filePath = isWin ? basePath.replaceAll('\\', '/') : basePath |
| | | const regex = new RegExp(`${filePath}/([^/]*)/index.ts`) |
| | | const NOT_PAGE = 'notPage:true' |
| | | /** |
| | | * 提取关键字符 |
| | | * @param {*} code |
| | |
| | | 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 |
| | | } |
| | | } |