Skip to content

Commit ff2019e

Browse files
committed
Skip adding importmap::tags component if it already exists on the page
1 parent c77bb16 commit ff2019e

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/Actions/ReplaceOrAppendTags.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ class ReplaceOrAppendTags
99

1010
public function __invoke(string $contents)
1111
{
12+
if (str_contains($contents, '<x-importmap::tasg />')) {
13+
return $contents;
14+
}
15+
1216
if (str_contains($contents, '@vite')) {
1317
return preg_replace(
1418
static::VITE_DIRECTIVE_PATTERN,

0 commit comments

Comments
 (0)