Skip to content

Commit

Permalink
Use the file extension to check file types
Browse files Browse the repository at this point in the history
This prevents issues with imported code that may use extensions like .css.js

Fixes #31
  • Loading branch information
timsnadden committed May 2, 2023
1 parent 256529b commit 724975e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export function buildEnd(err?: Error): void {
}

function useStyleSheetTransform(filename: string) {
return filename.match(/\.s?(a|c)ss/);
return path.extname(filename).match(/s?(a|c)ss/);
}

function useTypescriptTransform(filename: string) {
Expand Down

0 comments on commit 724975e

Please sign in to comment.