File tree Expand file tree Collapse file tree 3 files changed +11
-2
lines changed Expand file tree Collapse file tree 3 files changed +11
-2
lines changed Original file line number Diff line number Diff line change 102
102
"nanoid" : " ^3.1.23" ,
103
103
"npm-run-all" : " ^4.1.5" ,
104
104
"os-locale" : " ^6.0.0" ,
105
+ "pdf-lib" : " ^1.16.0" ,
105
106
"pkg" : " ^5.3.1" ,
106
107
"pkg-up" : " ^3.1.0" ,
107
108
"portfinder" : " ^1.0.28" ,
141
142
"cosmiconfig" : " ^7.0.0" ,
142
143
"express" : " ^4.17.1" ,
143
144
"import-from" : " ^4.0.0" ,
144
- "pdf-lib" : " ^1.16.0" ,
145
145
"pptxgenjs" : " ^3.7.1" ,
146
146
"puppeteer-core" : " 10.2.0" ,
147
147
"serve-index" : " ^1.9.1" ,
Original file line number Diff line number Diff line change @@ -261,7 +261,12 @@ export class Converter {
261
261
262
262
// Apply PDF metadata and annotations
263
263
const creationDate = new Date ( )
264
- const { PDFDocument, PDFHexString, PDFString } = await import ( 'pdf-lib' )
264
+ const { PDFDocument, PDFHexString, PDFString } = await import (
265
+ // Use pre-bundled pdf-lib to avoid circular dependency warning. pdf-lib
266
+ // as an external dependency will make failure in the standalone binary.
267
+ // @see https://github.com/marp-team/marp-cli/issues/373
268
+ 'pdf-lib/dist/pdf-lib.min.js'
269
+ )
265
270
const pdfDoc = await PDFDocument . load ( ret . buffer )
266
271
267
272
pdfDoc . setCreator ( CREATED_BY_MARP )
Original file line number Diff line number Diff line change @@ -14,3 +14,7 @@ declare module '*.scss' {
14
14
const scss : string
15
15
export default scss
16
16
}
17
+
18
+ declare module 'pdf-lib/dist/pdf-lib.min.js' {
19
+ export * from 'pdf-lib'
20
+ }
You can’t perform that action at this time.
0 commit comments