Quellcode durchsuchen

fix .d.ts choking on wrong import() paths

Adam Shaw vor 7 Jahren
Ursprung
Commit
367235222f
1 geänderte Dateien mit 6 neuen und 0 gelöschten Zeilen
  1. 6 0
      tasks/ts-types.js

+ 6 - 0
tasks/ts-types.js

@@ -23,7 +23,13 @@ function exec() {
     out: 'tmp/fullcalendar.d.ts'
   }).then(function() {
     let content = fs.readFileSync('tmp/fullcalendar.d.ts', { encoding: 'utf8' })
+
     content = filterModuleDeclaration(content)
+    content = content.replace(
+      /import\((['"])(..\/)+/g,
+      'import($1fullcalendar/src/'
+    )
+
     if (!fs.existsSync('dist')) {
       fs.mkdirSync('dist')
     }