We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent bea2812 commit faa7b47Copy full SHA for faa7b47
src/flask_vite/tags.py
@@ -5,6 +5,7 @@
5
from __future__ import annotations
6
7
import glob
8
+from pathlib import Path
9
from textwrap import dedent
10
11
from flask import current_app, url_for
@@ -20,8 +21,8 @@ def make_tag(*, static: bool = False):
20
21
22
23
def make_static_tag():
- js_file = glob.glob("vite/dist/assets/*.js")[0].split("/")[-1]
24
- css_file = glob.glob("vite/dist/assets/*.css")[0].split("/")[-1]
+ js_file = Path(glob.glob("vite/dist/assets/*.js")[0]).name
25
+ css_file = Path(glob.glob("vite/dist/assets/*.css")[0]).name
26
27
js_file_url = url_for("vite.static", filename=js_file)
28
css_file_url = url_for("vite.static", filename=css_file)
0 commit comments