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
Hello we have a use case that we want to use this plugin in the browser and bundle it via webpack.
Currently the FileSystemLoader is being use as a fallback loader if no load provided via the config, and it is always imported by the package index.
The issue is: FileSystemLoader imports nodejs fs module and that's not browser friendly (needs config in order to bundle).
I have few suggestions for solutions to this issue:
Add "browser" field to the package.json that will implement a "loader" that throws something like "when using this package in browser you must provide a custom loader"
Create entrypoint specifically for browser usage which does not import FileSystemLoader by default
Allow inject the fs module to the loaders avoiding importing it directly (split the index into a factory that will accept fs)
These are non-breaking changes that can be done here.
We are willing to make this PR.
Please advice.
The text was updated successfully, but these errors were encountered:
Hello we have a use case that we want to use this plugin in the browser and bundle it via webpack.
Currently the
FileSystemLoader
is being use as a fallback loader if no load provided via the config, and it is always imported by the package index.The issue is:
FileSystemLoader
imports nodejsfs
module and that's not browser friendly (needs config in order to bundle).I have few suggestions for solutions to this issue:
FileSystemLoader
by defaultfs
module to the loaders avoiding importing it directly (split the index into a factory that will acceptfs
)These are non-breaking changes that can be done here.
We are willing to make this PR.
Please advice.
The text was updated successfully, but these errors were encountered: