diff --git a/_includes/vite_script.html b/_includes/vite_script.html
index f35203e..a7607ac 100644
--- a/_includes/vite_script.html
+++ b/_includes/vite_script.html
@@ -1,5 +1,8 @@
{% capture entry %}{% if page.layout and layout.jsEntry %}{{ layout.jsEntry }}{% elsif page.jsEntry %}{{ page.jsEntry }}{% else %}default{% endif %}{% endcapture %}
{% vite_javascript_tag {{ entry }} %}
-{% capture entry_legacy %}{{ entry }}-legacy.js{% endcapture %}
-
-
+
+
+{% capture legacyFile %}{% vite_asset_path {{ entry }}-legacy.js %}{% endcapture %}
+
diff --git a/_plugins/jekyll-vite.rb b/_plugins/jekyll-vite.rb
index a968b0d..009e8d2 100644
--- a/_plugins/jekyll-vite.rb
+++ b/_plugins/jekyll-vite.rb
@@ -132,7 +132,7 @@ protected
# Internal: Renders HTML attributes inside a tag.
def stringify_attrs(**attrs)
- attrs.map { |key, value| %(#{ key }="#{ value }") }.join(' ')
+ attrs.map { |key, value| %(#{ key }#{ value && value != "" ? %(="#{value}") : "" }) }.join(' ')
end
# Internal: Renders an HTML tag of the specified type.