Closed leobm closed 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.
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.
ok, that makes sense. Thanks for your clarification.
when I run dojo build with the --serve flag: e.g.
dojo build --serve
ordojo build --watch --serve
current behavior: default mode is "dist"
expected behavior: default mode is "dev"