Skip to content

Commit a5c3c21

Browse files
committed
Check if exists after checking extension
1 parent 14ec5da commit a5c3c21

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/index.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,8 +126,7 @@ const init: tsModule.server.PluginModuleFactory = ({ typescript: ts }) => {
126126
};
127127

128128
languageServiceHost.getScriptSnapshot = (fileName) => {
129-
const fileExists = fs.existsSync(fileName);
130-
if (fileExists && isCSS(fileName)) {
129+
if (isCSS(fileName) && fs.existsSync(fileName)) {
131130
return getDtsSnapshot(
132131
ts,
133132
processor,

0 commit comments

Comments
 (0)