Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove use of deprecated require.extensions #82

Closed
benmccann opened this issue Dec 8, 2020 · 3 comments
Closed

Remove use of deprecated require.extensions #82

benmccann opened this issue Dec 8, 2020 · 3 comments

Comments

@benmccann
Copy link

require.extensions has been deprecated since 0.10.6: https://nodejs.org/api/modules.html#modules_require_extensions

const loadJS = require.extensions['.js'];

@lukeed
Copy link
Owner

lukeed commented Dec 8, 2020

This is intentional. May be deprecated, but it's how every require hook operates.

@lukeed lukeed closed this as completed Dec 8, 2020
@benmccann
Copy link
Author

@Rich-Harris just suggested in sveltejs/svelte#5770 (comment) that ESM with loader hooks would be a preferable alternative

@lukeed
Copy link
Owner

lukeed commented Dec 14, 2020

I can add a separate demonstration for --loader, but it only "replaces" require.extensions as much ESM replaces CommonJS. It still needs to be an explicit opt-in.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants