fix: normalize typescript lib path for rollup #366
Merged
+21
−3
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
本 PR 补充修复 #360 中新增的
getTsLibFolder
函数在 Win 环境下出现不符合预期的问题。预期结果 (末尾不包含
/lib/typescript.js
):错误结果:
在 Windows 环境下,由于路径分隔符斜杠和 Unix 环境不同,
require.resolve('typescript')
返回结果需要做normalizePath
处理,这样才能始终正确地 replace 去掉末尾的/lib/typescript.js
。#360 (comment)