dojo / cli

:rocket: Dojo - command line tooling.
http://dojo.io
Other
26 stars 34 forks source link

use "dev" as default mode when the serve flag is added to the build command. #202

Closed leobm closed 6 years ago

leobm commented 6 years ago

when I run dojo build with the --serve flag: e.g. dojo build --serve or dojo build --watch --serve

current behavior: default mode is "dist"

expected behavior: default mode is "dev"

agubler commented 6 years ago

Hey @leobm, this is really an issue for cli-build-app as that’s the command the determines the defaults for parameters. However the rationale for using dist as a default is that we don’t ever want consumers to accidentally distrubute/deploy dev code into production. In the future we will be looking to support aliases for commands such that consumers can describe commands plus options meaning that they’d be able to use something like dojo dev to run dojo build with the mode set as dev. In the meantime this is something that you can setup easily using npm scripts with an entry like:

"scripts": {
  "dev": "dojo build -m dev -w",
  "dev-serve": "dojo build -m dev -w -s"
}

I hope this helps clarify the initial design decisions.

agubler commented 6 years ago

And the reason we decided not to switch the default based on whether --serve is passed as an option is that it would lead to a confusing default API.

leobm commented 6 years ago

ok, that makes sense. Thanks for your clarification.