Description
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:
pin "extra", extname: ".jsm", preload: true
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.