pdfmake use in an application with webpack

2019-07-06 22:26发布

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条回答
唯我独甜
2楼-- · 2019-07-06 23:05

i solved my problem with the following code line: require("script!pdfmake"); You have to use the scriptloader from webpack.

查看更多
登录 后发表回答