mirror of
https://github.com/mkdocs/mkdocs.git
synced 2026-03-27 09:58:31 +07:00
Include *.mjs files into javascript_files()
This commit is contained in:
@@ -311,7 +311,7 @@ class LiveReloadServer(socketserver.ThreadingMixIn, wsgiref.simple_server.WSGISe
|
||||
def _guess_type(cls, path):
|
||||
# MkDocs only ensures a few common types (as seen in livereload_tests.py::test_mime_types).
|
||||
# Other uncommon types will not be accepted.
|
||||
if path.endswith((".js", ".JS")):
|
||||
if path.endswith((".js", ".JS", ".mjs")):
|
||||
return "application/javascript"
|
||||
if path.endswith(".gz"):
|
||||
return "application/gzip"
|
||||
|
||||
@@ -269,7 +269,7 @@ class File:
|
||||
|
||||
def is_javascript(self) -> bool:
|
||||
"""Return True if file is a JavaScript file."""
|
||||
return self.src_uri.endswith(('.js', '.javascript'))
|
||||
return self.src_uri.endswith(('.js', '.javascript', '.mjs'))
|
||||
|
||||
def is_css(self) -> bool:
|
||||
"""Return True if file is a CSS file."""
|
||||
|
||||
Reference in New Issue
Block a user