svelte-ts-preprocess
Advanced tools
Comparing version 1.0.0 to 1.0.1
{ | ||
"name": "svelte-ts-preprocess", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "Typescript preprocessor for Svelte 3", | ||
@@ -5,0 +5,0 @@ "main": "src/index.js", |
@@ -48,3 +48,3 @@ ***!!! THIS PREPROCESSOR IS VERY EXPERIMENTAL !!!*** | ||
preprocess: preprocess({ | ||
transformers: { | ||
transformers: { | ||
ts: ts().script | ||
@@ -51,0 +51,0 @@ }, |
@@ -5,3 +5,3 @@ const fs = require('fs'), | ||
function printDiagnostics(diagnostics) { | ||
function printDiagnostics(diagnostics = []) { | ||
diagnostics.forEach(diagnostic => { | ||
@@ -21,7 +21,7 @@ if (diagnostic.file) { | ||
script: ({ content, attributes, filename }) => { | ||
if (attributes && ['ts', 'typescript'].includes(attributes.lang)) return; | ||
if (attributes && ! ['ts', 'typescript'].includes(attributes.lang)) return; | ||
return new Promise(resolve => { | ||
options ? | ||
resolve(options) : | ||
options ? | ||
resolve(options) : | ||
fs.readFile('tsconfig.json', (err, content) => { | ||
@@ -28,0 +28,0 @@ if (err) throw err; |
5502