pdfmake 在带有 webpack 的应用程序中使用 [英] pdfmake use in an application with webpack
问题描述
我只是要在 Webpack 中构建一个应用程序,并希望集成 pdfmake 不幸的是我遇到了这个问题.我有文件pdfmake.js"在我的web_modules"文件夹中,并将它们放在
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 ");
当我打电话给:
pdfMake.createPdf(docDefinition).open ();
这样做,他告诉我CreatePDF"不是一个让我印象深刻的功能,我发现我在这些位置调用了文件保护程序"而不是pdfmake".有没有人遇到过这种情况?感谢您的帮助!
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!
推荐答案
我用下面的代码行解决了我的问题: require("script!pdfmake");你必须使用 webpack 中的脚本加载器.
i solved my problem with the following code line: require("script!pdfmake"); You have to use the scriptloader from webpack.
这篇关于pdfmake 在带有 webpack 的应用程序中使用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!