Skip to content

[Feature Request]: require a value for the --dir/-d option #8335

@CalmDownVal

Description

@CalmDownVal

What problem does this feature solve?

Passing the -d option to Rolldown with no value seems to default to the current working directory, which can be dangerous when --clean-dir is enabled - very sneaky behavior when cleanDir is enabled in rolldown.config.js.

I suggest that this option should strictly require a value. If one really intends to use the current directory as the output dir, it could be done via -d . or perhaps -d "".

I managed to wipe a few uncommitted changes today after passing the -d option by mistake. I realize the error is mine, but I do think it'd be safer with the strict requirement. Thank you for considering!

What does the proposed API look like?

  • $ rolldown ... builds accordingly to rolldown.config.js or by default into ./dist
  • $ rolldown -d . ... builds into current directory
  • $ rolldown -d ... throws an error
  • same behavior when used in the long form: --dir

Metadata

Metadata

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions