Skip to content

Commit

Permalink
(fix) manually define svelteSys.readFile for compatibility (#2142)
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonlyu123 committed Aug 27, 2023
1 parent c80a020 commit f35d311
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions packages/typescript-plugin/src/svelte-sys.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@ export function createSvelteSys(ts: _ts, logger: Logger) {
const extensionsWithSvelte = (extensions ?? []).concat('.svelte');

return ts.sys.readDirectory(path, extensionsWithSvelte, exclude, include, depth);
},
readFile(path, encoding) {
// imba typescript plugin patch this with Object.defineProperty
// and copying the property descriptor from a class that extends the original ts.sys
// so we explicitly define it here
return ts.sys.readFile(path, encoding);
}
};

Expand Down

0 comments on commit f35d311

Please sign in to comment.