问题
I'm just going to build an application in Webpack and would like to integrate pdfmake unfortunately I encounter this problems. I have the file "pdfmake.js" are in my "web_modules" folder and put them with
Var pdfmake = require(" pdfmake ");
When I call the:
pdfMake.createPdf(docDefinition).open ();
doing, he tells me "CreatePDF" is not a function that has struck me, and I found that I call the "File Saver" and not "pdfmake" get back at these locations. Has this happened to anyone of you have an idea? Thanks for your help!
回答1:
i solved my problem with the following code line: require("script!pdfmake"); You have to use the scriptloader from webpack.
来源:https://stackoverflow.com/questions/27421528/pdfmake-use-in-an-application-with-webpack