Skip to content

Commit faa7b47

Browse files
committed
fix: Windows compat.
1 parent bea2812 commit faa7b47

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/flask_vite/tags.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
from __future__ import annotations
66

77
import glob
8+
from pathlib import Path
89
from textwrap import dedent
910

1011
from flask import current_app, url_for
@@ -20,8 +21,8 @@ def make_tag(*, static: bool = False):
2021

2122

2223
def make_static_tag():
23-
js_file = glob.glob("vite/dist/assets/*.js")[0].split("/")[-1]
24-
css_file = glob.glob("vite/dist/assets/*.css")[0].split("/")[-1]
24+
js_file = Path(glob.glob("vite/dist/assets/*.js")[0]).name
25+
css_file = Path(glob.glob("vite/dist/assets/*.css")[0]).name
2526

2627
js_file_url = url_for("vite.static", filename=js_file)
2728
css_file_url = url_for("vite.static", filename=css_file)

0 commit comments

Comments
 (0)