diff --git a/src/index.ts b/src/index.ts index 006b54b..c08391e 100644 --- a/src/index.ts +++ b/src/index.ts @@ -145,7 +145,7 @@ export interface Options { function getExtension(filename: string): string { const index = filename.lastIndexOf('.'); - return index < 0 ? '' : filename.substring(index).replace(/\?.+$/, ''); + return index < 0 ? '' : filename.substring(index).replace(/\?.*$/, ''); } function containsSolidField(fields: Record) { const keys = Object.keys(fields); @@ -275,7 +275,7 @@ export default function solidPlugin(options: Partial = {}): Plugin { typeof extension === 'string' ? extension : extension[0], ); - if (!filter(id) || !(/\.[mc]?[tj]sx$/i.test(id) || allExtensions.includes(currentFileExtension))) { + if (!filter(id) || !(/^\.[mc]?[tj]sx$/i.test(currentFileExtension) || allExtensions.includes(currentFileExtension))) { return null; }