mirror of
https://github.com/chartjs/Chart.js.git
synced 2024-10-06 04:09:08 +02:00
fix: hotfix chart.js/auto for commonjs (#10992)
* fix: hotfix chart.js/auto for commonjs * fix: add auto.cjs to side effects
This commit is contained in:
parent
26f711df81
commit
bc84a98ec6
@ -1,6 +1,6 @@
|
||||
const exports = require('../dist/chart.cjs');
|
||||
const {Chart, registerables} = exports;
|
||||
const chartjs = require('../dist/chart.cjs');
|
||||
const {Chart, registerables} = chartjs;
|
||||
|
||||
Chart.register(...registerables);
|
||||
|
||||
module.exports = Object.assign(Chart, exports);
|
||||
module.exports = Object.assign(Chart, chartjs);
|
||||
|
@ -7,6 +7,7 @@
|
||||
"type": "module",
|
||||
"sideEffects": [
|
||||
"./auto/auto.js",
|
||||
"./auto/auto.cjs",
|
||||
"./dist/chart.umd.js"
|
||||
],
|
||||
"jsdelivr": "./dist/chart.umd.js",
|
||||
|
@ -2,7 +2,9 @@
|
||||
"private": true,
|
||||
"description": "chart.js should work in Node",
|
||||
"scripts": {
|
||||
"test": "node test.js"
|
||||
"test": "npm run test-index && npm run test-auto",
|
||||
"test-index": "node test.js",
|
||||
"test-auto": "node test-auto.js"
|
||||
},
|
||||
"dependencies": {
|
||||
"chart.js": "workspace:*"
|
||||
|
7
test/integration/node-commonjs/test-auto.js
Normal file
7
test/integration/node-commonjs/test-auto.js
Normal file
@ -0,0 +1,7 @@
|
||||
const Chart = require('chart.js/auto');
|
||||
const {valueOrDefault} = require('chart.js/helpers');
|
||||
|
||||
Chart.register({
|
||||
id: 'TEST_PLUGIN',
|
||||
dummyValue: valueOrDefault(0, 1)
|
||||
});
|
Loading…
Reference in New Issue
Block a user