preact-cli
preact-cli copied to clipboard
Watch mode without webpack's dev server
Do you want to request a feature or report a bug? Feature
What is the current behaviour?
When developing a custom server for SSR, the process of building the ssr-bundle is a very bad experience.
The build
command can take a long time and there's no watch mode, meaning every time there's a code change the developer needs to kill the server, build the entire application, and run the server again.
If the current behaviour is a bug, please provide the steps to reproduce.
What is the expected behaviour?
build
command could have a watch mode option
If this is a feature request, what is motivation or use case for changing the behaviour? This would greatly benefit developers that have custom servers and want a hot reload option.
Please mention other relevant information. I can create a PR for this.
Please paste the results of preact info
here.
As build
is meant to create a production build (coming from the ReadMe), would it be better to instead add an option to the watch
command in some capacity? Adding a watch feature to the build command would mean the entire production build/optimization process would be done on every change to the source, no?
Regardless, would be nice, I agree.
As
build
is meant to create a production build (coming from the ReadMe), would it be better to instead add an option to thewatch
command in some capacity? Adding a watch feature to the build command would mean the entire production build/optimization process would be done on every change to the source, no?Regardless, would be nice, I agree.
Makes total sense, was thinking of changing the env to development on the build command but I guess that will get messy.
Cool, should then add an option in the watch
that will:
- disable dev server
- add watch mode to webpack
- build the ssr-bundle
Wdyt?
That certainly sounds great.
Granted, I have absolutely no idea how much work that would be to add as I haven't even glanced at the source for prerendering, but it sounds like it would be a much improved experience, no doubt.
@RyanChristian4427 I've got the PR ready, how can I push a new branch to the repo?
To this repo? Unless I'm mistaken, you can't merge a fork into a new branch on the fork's origin.
If you want to merge into a branch rather than master for some reason, you'll need one of the maintainers to add one for you.
@RyanChristian4427 https://github.com/preactjs/preact-cli/pull/1264
is there any progress...? this feature would be great.
@gabrielrtakeda A PR has been made and it's roughly usable if you're interested in trying it. It's been pretty much untouched since being opened though.