Can't bundle jspdf into custom endpoint #10893
AlphaMoonbaseBerlin
announced in
Archive
Replies: 2 comments 4 replies
-
Looks like jsPDF is doing it's own dynamic import magic, which isn't compatible with the current rollup configuration. Any thoughts @nickrum |
Beta Was this translation helpful? Give feedback.
3 replies
-
Hi! I had the same problem and I resolved importing jspdf this way: |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I try to implement jspdf into a custom-endpoint.
When trying to build the extension, rollup throws the following error:
This seems to indikate that the rollup-implementation as set up to package everything into a single file.
I digged arround a little bit into the script and found that there is the chance to create a extensions.config.js to pass data to rollup. But trying to force it to either use dir-mode instead of file-mode or allowing inlineDynamicImports does not seem to work as intendet as in it does not have any effect. But maybe I'm missing some part here in how to setup the extensions.config.js correctly to pass that information:
Maybe this is not per se a bug but a feature-request or asking for en enhancment of the docs in regards to the rollup-config.
To Reproduce
npm install jspdf
index.js:
import { jsPDF } from "jspdf";
npm run build
Errors Shown
What version of Node.js are you using?
14.7.0
What operating system are you using?
Windows 10
Beta Was this translation helpful? Give feedback.
All reactions