Skip to content

Commit

Permalink
fix(module-tools): not execa tsc clean in js project (#5071)
Browse files Browse the repository at this point in the history
  • Loading branch information
10Derozan authored Dec 12, 2023
1 parent 82e0af0 commit 923fee7
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
6 changes: 6 additions & 0 deletions .changeset/selfish-hairs-invite.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@modern-js/module-tools': patch
---

fix(module-tools): not execa tsc clean in js project
fix(module-tools): 不在 js 项目执行 tsc clean
7 changes: 6 additions & 1 deletion packages/solutions/module-tools/src/builder/clear.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,12 @@ export const clearBuildConfigPaths = async (
}

// tsc --build --clean
if (config.buildType === 'bundleless' && config.dts) {
if (
config.buildType === 'bundleless' &&
config.dts &&
// keep it same as https://github.com/web-infra-dev/modern.js/blob/main/packages/solutions/module-tools/src/builder/build.ts#L37
(await fs.pathExists(config.tsconfig))
) {
const tscBinFile = await getTscBinPath(projectAbsRootPath);
const childProgress = execa(tscBinFile, ['--build', '--clean'], {
stdio: 'pipe',
Expand Down

0 comments on commit 923fee7

Please sign in to comment.