Making 'DirectoryHasher' more re-usable |
A little background, I was poking around with some Sass / JS minifier libraries implemented with PHP, rather than node/npm, and they seem to work quite well, easy enough to write CI4 command to get it building.
I'd now like to add an option for "watch for file changes" I was looking at how Toolbar hot reloader works and CI already has done all the hard work and built DirectoryHasher. The only problem is the Hasher is hard-coded to get observed directory list directly from the toolbar config file. Looks like it wouldn't be too hard to either add a method to take in array of folders to watch, or take it in as part of the construct method, and inject the configuration array from HotReloader class, where Hasher is initiated. That way the DirectoryHasher becomes re-usable for any other use cases, straight out of the box. Would that be worth considering as a PR or change request?
(05-30-2024, 01:06 PM)pert Wrote: A little background, I was poking around with some Sass / JS minifier libraries implemented with PHP, rather than node/npm, and they seem to work quite well, easy enough to write CI4 command to get it building. Yes, it would be great to have that option in CodeIgniter 4. It's a good idea. I support it I would fully support this pull request or change request proposal, and I think many other CodeIgniter developers would also like this functionality.
Yes, there is no reason to hard code the directory list.
YES
The same here. I use css/js PHP minifier with CLI spark command. Custom built. Your mentioned feature would be very handy. YES |
Welcome Guest, Not a member yet? Register Sign In |