Summary of changes in 5.0.0-5.0.2
- Breaking: The plugin is no longer auto applied to jsPDF in none browser environments (see more below)
- The esm build file is now chosen automatically based on your packages environment (no need to use the
jspdf-autotable/es
path anymore) - HookData is now exported #1075
Plugin no longer applied automatically
In this release the plugin is no longer auto applied to jsPDF in none browser environments. This is a breaking change for users that for example uses this plugin in node js and call autoTable method on the jsPDF doc instance (doc.autoTable({...}).
It is now recommended to import the autoTable method and pass it the jsPDF doc instance.
import { jsPDF } from 'jspdf'
import { autoTable } from 'jspdf-autotable'
const doc = new jsPDF()
autoTable(doc, { ... })
If you want to keep calling the plugin method on the jsPDF doc instance you can also apply the plugin to it yourself using applyPlugin:
import { jsPDF } from 'jspdf'
import { applyPlugin } from 'jspdf-autotable'
// This is now required in non browser environments to use the old
// way of calling autoTable on the jspdf doc instance.
applyPlugin(jsPDF)
const doc = new jsPDF()
doc.autoTable({ ... })