Skip to content

*.cjs extension files served as text/plain #355

@Swivelgames

Description

@Swivelgames

Modern Node.js modules can be served as ESMs or CommonJS modules. These are differentiated either by their package.json, or by the extension of the file. It appears that unpkg properly serves .mjs files, but seems to treat *.cjs files as plaintext incorrectly.

Instead of text/plain, the content-type of .cjs files should be application/javascript.

Node's documentation can serve as reference for the honoring of these files: https://nodejs.org/api/modules.html#enabling

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