Merge pull request #8042 from fkunn1326/master

Add .mjs support for extensions
This commit is contained in:
AUTOMATIC1111 2023-03-11 15:18:05 +03:00 committed by GitHub
commit e15c4f31e3

View File

@ -1754,6 +1754,9 @@ def reload_javascript():
for script in modules.scripts.list_scripts("javascript", ".js"): for script in modules.scripts.list_scripts("javascript", ".js"):
head += f'<script type="text/javascript" src="file={script.path}?{os.path.getmtime(script.path)}"></script>\n' head += f'<script type="text/javascript" src="file={script.path}?{os.path.getmtime(script.path)}"></script>\n'
for script in modules.scripts.list_scripts("javascript", ".mjs"):
head += f'<script type="module" src="file={script.path}?{os.path.getmtime(script.path)}"></script>\n'
head += f'<script type="text/javascript">{inline}</script>\n' head += f'<script type="text/javascript">{inline}</script>\n'
def template_response(*args, **kwargs): def template_response(*args, **kwargs):