Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tighten check for Moment #6113

Merged
merged 1 commit into from Mar 6, 2019
Merged

Conversation

jonrimmer
Copy link
Contributor

This slightly tightens the check for Moment. This is so you can use the browser field to exclude Moment from the bundle (as per #5978). By default, ignoring a module makes it return an empty object, and this was passing the check.

@simonbrunel simonbrunel added this to the Version 2.8 milestone Mar 5, 2019
@simonbrunel
Copy link
Member

Just tested with this project reported in this comment (@lsn793) and it works as expected with:

// package.json
{
  "browser": {
    "moment": false
  }
}

Thanks @jonrimmer for this find.

I also noticed that this project includes chartjs-plugin-annotation which had chart.js as dependency (instead of peer dependency). The consequence is that Chart.js is included two times in the built file. And it's currently the same with the zoom plugin (until 0.7.0, not released yet).

Angular projects using the zoom and annotation plugins will get the source of Chart.js included 3 times in the built file (I didn't try with Webpack projects). I don't understand why this hasn't been already reported.

@simonbrunel simonbrunel merged commit d3b7559 into chartjs:master Mar 6, 2019
exwm pushed a commit to exwm/Chart.js that referenced this pull request Apr 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants