mirror of
https://github.com/chartjs/Chart.js.git
synced 2024-10-06 04:09:08 +02:00
Provide auto-registering entry point (#8429)
This commit is contained in:
parent
c040b8255e
commit
9043325a6e
4
auto/auto.esm.d.ts
vendored
Normal file
4
auto/auto.esm.d.ts
vendored
Normal file
@ -0,0 +1,4 @@
|
||||
import { Chart } from '../dist/chart.esm';
|
||||
|
||||
export * from '../dist/chart.esm';
|
||||
export default Chart;
|
5
auto/auto.esm.js
Normal file
5
auto/auto.esm.js
Normal file
@ -0,0 +1,5 @@
|
||||
import {Chart, registrables} from '../dist/chart.esm';
|
||||
|
||||
Chart.register(...registrables);
|
||||
|
||||
export default Chart;
|
1
auto/auto.js
Normal file
1
auto/auto.js
Normal file
@ -0,0 +1 @@
|
||||
module.exports = require('../dist/chart');
|
8
auto/package.json
Normal file
8
auto/package.json
Normal file
@ -0,0 +1,8 @@
|
||||
{
|
||||
"name": "chart.js-auto",
|
||||
"private": true,
|
||||
"description": "auto registering package",
|
||||
"main": "auto.js",
|
||||
"module": "auto.esm.js",
|
||||
"types": "auto.esm.d.ts"
|
||||
}
|
@ -90,6 +90,12 @@ import { Chart, registerables } from 'chart.js';
|
||||
Chart.register(...registerables);
|
||||
```
|
||||
|
||||
And finally there is an separate path to do just the above for you, in one line:
|
||||
|
||||
```javascript
|
||||
import Chart from 'chart.js/auto';
|
||||
```
|
||||
|
||||
## Require JS
|
||||
|
||||
**Important:** RequireJS [can **not** load CommonJS module as is](https://requirejs.org/docs/commonjs.html#intro), so be sure to require one of the UMD builds instead (i.e. `dist/chart.js`, `dist/chart.min.js`, etc.).
|
||||
|
@ -25,6 +25,8 @@
|
||||
"url": "https://github.com/chartjs/Chart.js/issues"
|
||||
},
|
||||
"files": [
|
||||
"auto/**/*.js",
|
||||
"auto/**/*.d.ts",
|
||||
"dist/*.js",
|
||||
"dist/*.d.ts",
|
||||
"dist/chunks/*.js",
|
||||
|
Loading…
Reference in New Issue
Block a user