Closed kudla closed 5 months ago
Hi. This allows to customize file extensions to be loaded for the Registry.
As an alternative it is really possible to handle this on a srcLoader level. Still it could be useful to address this in general for the cases like
srcLoader
WithLoadExtensions(".mjs", ".js", ".json"), WithLoader(func(name string) ([]byte, error) { if /* some custom condition */ { // some custom implementation } // Fallback. for default loader return require.DefaultSourceLoader(name) }),
Hi. Thanks for the submission.
The current loading mechanism tries to follow the standard as close as possible. Any customisations or modifications should be left external.
Hi. This allows to customize file extensions to be loaded for the Registry.
As an alternative it is really possible to handle this on a
srcLoader
level.Still it could be useful to address this in general for the cases like