Open
Description
See: https://nodejs.org/api/modules.html#modules_require_extensions
This is currently deprecated in Node.js, but several prominent JavaScript projects are using it, with no plans to migrate to anything else.
One example is the popular UI framework Svelte. Here's a recent issue asking about use of require.extensions
:
require.extensions
is deprecated, but extremely unlikely to ever be removed any time soon. There are better ways to structure your app so that compilation happens beforehand, but there isn't really a better way to compile on demand when therequire()
happens. We can't stop using this without removing a feature from Svelte, which would be a breaking change.
Would you accept a PR for adding this?