-
Notifications
You must be signed in to change notification settings - Fork 21
Conversation
"build": { | ||
"command": "ng build", | ||
"directory": "dist" | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are there some frameworks where the build directory might be different in watch mode vs normal mode?
Probably not, but asking just in case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Build directory in watch mode isn't really a thing...
When you run a framework in development/watch mode it starts an http server and users (and the CLI) access it for content (maybe we should call it dev
and not watch
).
Sometimes that dev server writes content to the build dir and sometimes it doesn't (depending on the framework).
The CLI detectors code doesn't have that distinction too:
https://github.com/netlify/cli/blob/abcbd07528b6d847594266ff788575e990d8b24a/src/detectors/angular.js#L24
Please let me know if that makes sense.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am thinking of watch mode in a more general sense. For example, some of our detectors are Gulp and Grunt, which do not necessarily use an HTTP server for the watch mode. For those, the watch mode is more likely to just re-run the build command on file updates, i.e. to re-populate the build directory.
I was wondering if there could be some frameworks or situation where that build directory in watch mode would use a separate directory.
I think I might be confused around the word "watch" which makes me think of filesystem watch mode, whereas what we actually mean might be "dev" as you mention, i.e. filesystem watch mode + serving files on a local HTTP server?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I might be confused around the word "watch" which makes me think of filesystem watch mode, whereas what we actually mean might be "dev" as you mention, i.e. filesystem watch mode + serving files on a local HTTP server?
Exactly - that's the difference. What the CLI needs is the dev
command and port
.
I can make another PR to rename watch
to dev
. We can have it under the major version bump.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I think this renaming would help clear any confusion 👍
Also, it makes it clear that property is intended for netlify dev
.
Fixes #63
Fixes #64
Changes:
directory
fromwatch
tobuild
(doesn't really makes sense to have it underwatch
).watch
empty).