sweet-js / sweet-core

Sweeten your JavaScript.
https://www.sweetjs.org
BSD 2-Clause "Simplified" License
4.59k stars 209 forks source link

Add ability to select extensions to resolve #619

Closed disnet closed 7 years ago

disnet commented 7 years ago

By default resolve only looks for files with .js as an extension. This adds the ability for the NodeLoader to enable additional extensions to resolve.

gabejohnson commented 7 years ago

Have you thought about this wrt lang? I was thinking about a file that maps file extension/paths/globs -> language. This would obviate the need for lang directives in every file w/ a particular extension.

disnet commented 7 years ago

I'm really not a fan of semantic file extensions. Much better to be declarative in your code imo.

That said, I wouldn't be opposed to adding the ability to do this. I would just strongly discourage people from using it 😄