Skip to content

Allow to pin modules with .jsm extension #99

Open
@mildred

Description

@mildred

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions