-
Notifications
You must be signed in to change notification settings - Fork 4
feat: add clean option to clear output path before bundling #30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -39,3 +39,4 @@ screenshot | |
| .eslintcache | ||
|
|
||
| build | ||
| .takumi/todos | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,7 +5,7 @@ import type { | |
| Stats, | ||
| } from '@kmijs/bundler-shared/rspack' | ||
| import type { Configuration } from '@kmijs/bundler-shared/rspack' | ||
| import { logger } from '@kmijs/shared' | ||
| import { logger, rimraf } from '@kmijs/shared' | ||
| import { Env, type IUserConfig } from '../types' | ||
| import { esbuildCompressErrorHelper } from '../utils/esbuildCompressErrorHelper' | ||
| import type { | ||
|
|
@@ -72,6 +72,23 @@ export abstract class BaseBundler< | |
| let isFirstCompile = true | ||
|
|
||
| return new Promise((resolve, reject) => { | ||
| if (opts.clean) { | ||
|
||
| bundlerConfigs.forEach((config) => { | ||
| if (config.output?.path) { | ||
| try { | ||
| logger.verbose( | ||
| `[BaseBundler] Cleaning output directory: ${config.output.path}`, | ||
| ) | ||
| rimraf.sync(config.output.path) | ||
| } catch (error) { | ||
| logger.verbose( | ||
| `[BaseBundler] Cleaning output directory: ${config.output.path} failed`, | ||
| ) | ||
| } | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Bug: Error Logging Missing in Directory CleanupWhen cleaning the output directory fails, the |
||
| } | ||
| }) | ||
| } | ||
|
|
||
| const compiler = this.createCompiler({ | ||
| ...buildOptions, | ||
| bundlerConfigs, | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: Gitignore Includes Personal Todo File
The
.takumi/todosfile was accidentally added to.gitignore. This appears to be personal/temporary content unrelated to the main feature.Locations (1)
examples/ant-pro/.gitignore#L41-L42Fix in Cursor • Fix in Web