Skip to content

Start With CommonJS Instead of AMD? #120

@julkue

Description

@julkue

A plugin of mine – mark.js – needs the name mark.js in CommonJS environments, and markjs in RequireJS environments due to the fact that otherwise RequireJS will try to load a file mark.js directly instead of the plugin specified in the dependency path (Example of a working path naming).

Due to the fact that Webpack and others support both – AMD and CommonJS – it would be safer to name the CommonJS statement before the AMD statement. Because otherwise it would take the AMD statement which would be markjs in my above named examplen, and markjs isn't valid for CommonJS environments (because the node module name is mark.js).

I guess this is a common approach for JavaScript modules where the name is ending with .js.

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