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

Only export the plugins module #19

Closed
wants to merge 1 commit into from
Closed

Conversation

Dragnucs
Copy link

This changes make the plugin only exports itself for a better integration with modern workflows (webpack, etc.). Registering the plugins will be up to the user.

Usage will look like:

import Stacked100 from 'chartjs-plugin-stacked100'

const chart = new Chart(ctx, {
        type: 'bar',
        plugins: [Stacked100],
        // ...
}

This changes make the plugin only exports itself for a better integration with modern workflows (webpack, etc.). Registering the plugins will be up to the user.

Usage will look like:

```javascript
import Stacked100 from 'chartjs-plugin-stacked100'

const chart = new Chart(ctx, {
        type: 'bar',
        plugins: [Stacked100],
        // ...
}
```
@y-takey
Copy link
Owner

y-takey commented Jul 27, 2018

Hi @Dragnucs , sorry for the delay, and thanks for your PR! :)
I agree your idea, but i want to leave a way using on browser directly (without bundler, like this)
Do you have any idea? for support both ways.

@DZN1636
Copy link

DZN1636 commented Dec 9, 2018

For webpack user, you can just import the plugin after having installed it, it will work just fine:

import Chart from 'chart.js'; 
import 'chartjs-plugin-stacked100';

// To use it:
const ctx = document.getElementById('graph_id').getContext('2d');
new Chart(ctx, { ... });

@Dragnucs
Copy link
Author

Dragnucs commented Dec 17, 2018 via email

@y-takey
Copy link
Owner

y-takey commented Jan 14, 2019

@Dragnucs , First of all, Thank you for a PR!
I would like to avoid breaking change. so may I close this PR?
Maybe, it will merge this change at next major version up.

@Dragnucs Dragnucs closed this Jan 14, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants