-
Notifications
You must be signed in to change notification settings - Fork 55
Description
I think we should do some cleanup on how parse CLI command/flags.
Opening this issue to list some ideas.
See for example #762
Some thoughts:
-
We should document all the commands (build, preview, ...) and what arguments they take
-
getArgs()
As of today we call getArgs()
first which compute the args for all the commands.
Maybe what we should do instead is to get the command first by looking at the first argument and let each command parse their arguments.
For ex. we pass the same parseArgs config for all commands when most of the config does only apply to build.
compileOpenNextConfig
compileOpenNextConfig
is called whatever the command is at the beginning of runCommand
.
I think we could just call it for the build
command and retrieve the built version for other commands.
(same goes for createOpenNextConfigIfNotExistent
)
We should also create a commands/build.ts
as we have for all other commands.