Skip to content

Commit b9fb90e

Browse files
committed
Update Decorator file
1 parent 1f1ea3a commit b9fb90e

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

src/Config/env.default

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,9 @@
55
VITE_ORIGIN='http://localhost:3479'
66
VITE_PORT=3479
77
VITE_BUILD_DIR='build'
8-
VITE_BUILD_DIR= 'build'
98
VITE_ENTRY_FILE='main.js'
109
VITE_RESOURCES_DIR='resources'
1110
VITE_FRAMEWORK='none'
11+
# Set this to false, or otherwise the plugin will try to add a div with an app id in your view file
12+
VITE_ADD_APP_ID='true'
1213
VITE_BACKUP_FILE=

src/Decorator.php

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,13 @@ public static function decorate(string $html): string
1717
# Insert tags just before "</head>" tag.
1818
$html = empty($tags) ? $html : str_replace('</head>', "\n\t$tags\n</head>", $html);
1919

20-
# Insert app id just after body tag
21-
$html = empty($tags) ? $html : str_replace('<body>', "<body>\n\t<div id=\"app\">", $html);
22-
# Close it.
23-
$html = empty($tags) ? $html : str_replace('</body>', "\n\t</div>\n</body>", $html);
20+
if (env('VITE_ADD_APP_ID') == "true")
21+
{
22+
# Insert app id just after body tag
23+
$html = empty($tags) ? $html : str_replace('<body>', "<body>\n\t<div id=\"app\">", $html);
24+
# Close it.
25+
$html = empty($tags) ? $html : str_replace('</body>', "\n\t</div>\n</body>", $html);
26+
}
2427
}
2528

2629
# If not, then just return the html as it is.

0 commit comments

Comments
 (0)