chartjs / chartjs-adapter-luxon

Luxon adapter for Chart.js
MIT License
33 stars 24 forks source link

Support Chart.js 3's ES6 default export and release 0.2.1 #13

Closed benmccann closed 4 years ago

benmccann commented 4 years ago

I'm trying Chart.js 3.0.0-alpha out in a webpack project. Webpack compiles the luxon adapter code to chart_js._adapters._date.override({ , but chart_js._adapters is undefined

This fix should still work for Chart.js 2 as well

This change allows the library to load for me. It still fails at runtime against a version I'm including via npm link, but that's because it finds chartjs-adapter-luxon/node_modules/chart.js and tries to use it. So while I haven't been able to thoroughly test this, my expectation is that it would work just fine using a released version since it wouldn't find a second version of Chart.js if grabbing it from npm instead of using the linked version.