Smarter building when serving
See original GitHub issue- this is a feature request, not a bug report, so I’m not really going to follow this issue template
The feature request
preact create typescript myproj
cd myproj
yarn serve
The yarn serve
command fails, because there’s no build/
folder. Here’s a feature for convenience:
- if
build/
doesn’t exist whenyarn serve
is run, then runyarn build
and then serve so no error occurs - if I change some files and run
yarn serve
, I think (I haven’t tested this) preact will serve the old files. preact should detect if the files have changed: if they have, build before serving
Regardless of whether the second part of this feature has already been implemented, the first part is still a minor feature that’s worth having.
Implementation choices
I can’t immediately recall libraries that do this, but I’m certain there are some major repositories that do this.
- there’s a package on NPM that does this: https://www.npmjs.com/package/build-if-changed
- we could use git (I think), but I’m not a fan of this idea because if an ignored file changes, we should trigger a rebuild
- we could get hashes of every file and store a cache, and when
build
is triggered, recalculate hashes and see if they match: if they don’t, rebuild, else, use the old build (this is a pretty much reimplementing the first option)
Issue Analytics
- State:
- Created 3 years ago
- Comments:10 (7 by maintainers)
Top Results From Across the Web
Intelligent Buildings - an overview | ScienceDirect Topics
Smart building is a type of building with reasonable investment, efficient energy management, and comfortable and convenient environment, designed by ...
Read more >Smart Building Services
Serving People. Building Technology. SBS was built with the purpose of serving our clients and team members well. We are experts in Building...
Read more >Smart Building Service & Maintenance - MacDonald-Miller
As your full-service building partner, MacDonald-Miller is here to provide a smarter approach to traditional HVAC service and maintenance.
Read more >Smart Building Technologies: Examples and Opportunities
Smart building technology is growing in popularity with each passing day due to its effectiveness in serving a business with accuracy.
Read more >7 Smart Building Technologies To Help You Better Manage ...
AI-enabled Service Automation software then predicts upcoming maintenance and even reviews and approves work orders with minimal human ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I think you’re on the wrong repository, You meant to post this on preact-cli I’ll transfer this issue for you.
FWIW Webpack 5 actually includes disk-backed caching, which is basically what the original proposal hints at. We could try it here to see if it’s an improvement for build times.