You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It's an unwritten rule that gulp plugin developers should not use fs. I would like to know why that is, and if so, what is the alternative?
Use case: you stream html files to a plugin which gets the paths to the externally linked resources and pulls those in. Would you not use fs for that? If not, how would you do it?
The text was updated successfully, but these errors were encountered:
@jonkemp Unless your file is at the top of the stream you shouldn't use fs. You should only deal with files that are passed to you.
To solve your example you would read ./html/* and pass it to the plugin instead of passing ./html/index.html and having the plugin resolve the dependencies on the real file system
3rd party modules aren't easy to work with though so we have lots of plugins that do resolve dependencies on the fs still. Working to provide tools to fix that for gulp 4 (#357)
It's an unwritten rule that gulp plugin developers should not use
fs
. I would like to know why that is, and if so, what is the alternative?Use case: you stream html files to a plugin which gets the paths to the externally linked resources and pulls those in. Would you not use fs for that? If not, how would you do it?
The text was updated successfully, but these errors were encountered: