Skip to content

Commit

Permalink
Fix: Generated .d.ts passed to generator
Browse files Browse the repository at this point in the history
  • Loading branch information
sapphi-red committed Dec 17, 2020
1 parent 6ecfd87 commit e0f5bd2
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/createDts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,13 @@ export const createDtsSnapshot = (
logger: Logger
): ts.IScriptSnapshot => {
const text = scriptSnapshot.getText(0, scriptSnapshot.getLength())

// Sometimes the generated dts are passed
// relates https://github.com/mrmckeb/typescript-plugin-css-modules/issues/41
if (text.includes('export default data')) {
return scriptSnapshot
}

let dts
try {
const data = toml.parse(text)
Expand Down

0 comments on commit e0f5bd2

Please sign in to comment.