-
Notifications
You must be signed in to change notification settings - Fork 120
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
Allow to pin modules with .jsm extension #99
Comments
Note that |
If other filename extensions than
#57 has been updated to provide this, while keeping the accepted extensions in one place. From there, making the extensions configurable instead of hardcoding them adds four more lines, ensuring compatibility of import maps with the (still) existing asset pipeline. |
The fact is that some packages out there are not using the plain For example chart.js main module name is |
The preference for |
The .jsm extension can be used to refer to javascript modules, and allows to distinguish javascript files from those that are used as modules. In some circumstances, it can be useful to make this distinction.
My use case : I use a source bundler (esbuild) and I want to register some imports as external so the bundled code can make a reference to another javascript module in the browser. It allows for lighter bundles and also allows to import dynamic modules. I planned to use the .jsm extension for that.
importmap should allow to pin .jsm modules. Proposed syntax:
The
extname
keyword is already in use in sprockets to refer to assets by name in order to have sprockets compute the correct asset path.Also,
.jsm
should be a registered mime type by default.The text was updated successfully, but these errors were encountered: