Open alanmoo opened 7 years ago
By "development script", do you mean running a local build?
Yup, scripts for use during local development. I feel like we should have at least one standard one across projects which perhaps runs an install and watches files when run.
Usually that's already covered by start
.
I'd standardize start
as containing:
npm i
Proposed standard naming:
start
build:*
server:*
watch:*
test:*
:*
denoting potential subtasks, eg watch:html
.I'm still not sure I love npm i
being a part of start
- it often slows things down. If we started using yarn, I could see that as it's pretty fast to validate existing packages are installed properly. Though I feel like I've run into this issue before.
Also, would server
then be the command to run the project as it will run in production? Basically start
without the watch tasks? I feel like we should go the other way where start
works as production, but then a dev
task sprinkles in some extra usefulness (like watch
).
I'm still not sure I love npm i being a part of start- it often slows things down.
Oh, I thought you liked it because you asked for it on Science. I'm fine not having npm i
as part of start
, but I don't find it problematic either. I'm not generally re-running start
repeatedly. yarn
is a good reason to leave it out if people want to use it.
Also, would server then be the command to run the project as it will run in production?
I like to do either:
server
if dev and prod have no real difference. (EG: static generated sites)server:dev
and server:prod
if there's a difference. (EG: science.mozilla.org
)I feel like we should go the other way where start works as production, but then a dev task sprinkles in some extra usefulness (like watch).
That's the opposite of the convention that we've been using on most projects.
Obviously we've got
start
, but what about development scripts?npm run dev
?