Skip to content

Cannot include Moment.js and Chart.js with RequireJS separately #4987

@daniel-evers

Description

@daniel-evers

Expected Behavior

To be able to include Moment.js and Chart.js with RequireJS without using the bundle version of Chart.js to avoid that Moment.js has to be included twice and possibly in different versions.

Current Behavior

The example at https://jsfiddle.net/8m67zr8y/1/ shows that Chart.js cannot find Moment.js, although Moment.js is basically available.

The example at https://jsfiddle.net/8m67zr8y/ shows the current possibility. However, Moment.js is included twice in this case.

Possible Solution

Provide a configuration option to pass a reference to the Moment.js instance explicitly or try to include Moment.js in an AMD environment with require('moment') for example.

Steps to Reproduce (for bugs)

See examples at https://jsfiddle.net/8m67zr8y/ and https://jsfiddle.net/8m67zr8y/1/

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