How to use the updateImportDeclaration function from typescript
Find comprehensive JavaScript typescript.updateImportDeclaration code examples handpicked from public code repositorys.
GitHub: franzzua/cmmn
32 33 34 35 36 37 38 39 40 41
const sourceFileDir = path.dirname(sourceFile.path); const abs = path.resolve(sourceFileDir, file); if (/\.(less|css|scss|sass|svg|png|html)$/.test(file)) { const absSource = path.join(options.outDir, path.relative(options.baseUrl, sourceFileDir)); const relFile = path.relative(absSource, abs).replaceAll(path.sep, '/'); return ts.updateImportDeclaration(importNode, importNode.decorators, importNode.modifiers, importNode.importClause, ts.createStringLiteral(relFile)); } if (/\.(json|tsx?|jsx?)$/.test(file)) return; if (fs.existsSync(abs + '.ts') || fs.existsSync(abs + '.tsx')) {
0
2
1
+ 59 other calls in file
typescript.SyntaxKind is the most popular function in typescript (82777 examples)