Skip to content

Commit

Permalink
fix: fix regex
Browse files Browse the repository at this point in the history
  • Loading branch information
brandonroberts committed Oct 13, 2022
1 parent 4e69c59 commit 944c421
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/vite-plugin-angular/src/lib/angular-vite-plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ type FileEmitter = (file: string) => Promise<EmitFileResult | undefined>;
* Match .(c or m)ts, .ts extensions with an optional ? for query params
* Ignore .tsx extensions
*/
const TS_EXT_REGEX = /\.[cm]?ts([^x])?\??$/;
const TS_EXT_REGEX = /\.[cm]?ts[^x]?\??/;

export function angular(options?: PluginOptions): Plugin[] {
/**
Expand Down Expand Up @@ -180,7 +180,9 @@ export function angular(options?: PluginOptions): Plugin[] {
return;
}

console.log('id', id);
if (TS_EXT_REGEX.test(id)) {
console.log('in');
if (id.includes('.ts?')) {
// Strip the query string off the ID
// in case of a dynamically loaded file
Expand Down

0 comments on commit 944c421

Please sign in to comment.