Skip to content

Commit

Permalink
fix regexp bug
Browse files Browse the repository at this point in the history
  • Loading branch information
martrapp committed Jan 22, 2024
1 parent 4f44877 commit 8a3f6cf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion integration/vite-plugin-extend.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export default function vitePluginVtbotExtend(opts: ExtendOptions): Plugin {
transform(code: string, id: string) {
let { linter, loading } = opts;
if (!import.meta.env.DEV) linter = false;
if ((!linter && !loading) || id.match('vtpl[123]\.astro$') || !id.endsWith('.astro')) return;
if ((!linter && !loading) || id.match(/vtpl[123]\.astro$/) || !id.endsWith('.astro')) return;

const replacement = `"astro-vtbot/vtex${loading ? (linter ? "3" : "2") : "1"}"`;
const match = code.match(/from\s*['"]astro:transitions["']/ms);
Expand Down

0 comments on commit 8a3f6cf

Please sign in to comment.