問題描述
Monorepos 和跨包開發。使用 src/ 或 dist/? (Monorepos and cross package development. To use src/ or dist/?)
編譯</em> dateTimeHelpers
包(又名frontend
正在使用dateTimeHelpers/dist 文件夾),或者你的前端會導入從 dateTimeHelpers
獲取 src 代碼並即時編譯(或僅在構建時)?</p>
所有包都是用 TypeScript 編寫的,需要按順序構建步驟供使用。
感謝您接受這個。我很難看到我應該拍攝什麼。我有 dist
使用工作 ‑ 但我不想運行兩個構建命令或在開發時必須構建臨時。
乾杯
正在使用 dateTimeHelpers/dist 文件夾),或者您的前端是否會從dateTimeHelpers
導入 src 代碼並即時編譯(或僅在它構建)?</p> 所有的包都是用 TypeScript 編寫的,需要一個構建步驟才能使用。
感謝您接受這個。我很難看到我應該拍攝什麼。我有 dist
使用工作 ‑ 但我不想運行兩個構建命令或在開發時必須構建臨時。
乾杯
正在使用 dateTimeHelpers/dist 文件夾),或者您的前端是否會從dateTimeHelpers
導入 src 代碼並即時編譯(或僅在它構建)?</p> 所有的包都是用 TypeScript 編寫的,需要一個構建步驟才能使用。
感謝您接受這個。我很難看到我應該拍攝什麼。我有 dist
使用工作 ‑ 但我不想運行兩個構建命令或在開發時必須構建臨時。
乾杯
/p>所有的包都是用 TypeScript 編寫的,需要一個構建步驟才能使用。
感謝您接受這個。我很難看到我應該拍攝什麼。我有 dist
使用工作 ‑ 但我不想運行兩個構建命令或在開發時必須構建臨時。
乾杯
/p>所有的包都是用 TypeScript 編寫的,需要一個構建步驟才能使用。
感謝您接受這個。我很難看到我應該拍攝什麼。我有 dist
使用工作 ‑ 但我不想運行兩個構建命令或在開發時必須構建臨時。
乾杯
參考解法
方法 1:
I am going to close this question, because I believe that this is the proper behavior to fix it!
Seems that even within the TS community, there is confusion on this.
When you build within frontend/
it should know that dateTimeHelpers
is a dependency and subsequently build that.
So this means that each package is always working out of dist/
but webpack knows to compile across packages.
https://github.com/TypeStrong/ts‑loader/releases/tag/v8.0.0
https://github.com/TypeStrong/ts‑loader/issues/1114
(by MichaelA58、MichaelA58)