Skip to content

Commit

Permalink
.mjs extension for JavaScript modules
Browse files Browse the repository at this point in the history
  • Loading branch information
laukstein committed Jun 24, 2018
1 parent d2c8459 commit f3b7136
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions ~config/httpd.conf
Original file line number Diff line number Diff line change
Expand Up @@ -120,14 +120,14 @@ TraceEnable off
SetEnvIf Remote_Addr "127.0.0.1" dontlog
# SetEnvIf Remote_Addr "::1" dontlog
# Do not log various assets
SetEnvIf Request_URI \.(a?png|crx|css|eot|gif|ico|jpe?g|js|mp4|oga|ogg|ogv|otf|pdf|svg|ttf|txt|vcard|vcf|webm|webmanifest|wasm|webp|woff|woff2|xml|xsl)$ dontlog
SetEnvIf Request_URI \.(a?png|crx|css|eot|gif|ico|jpe?g|m?js|mp4|oga|ogg|ogv|otf|pdf|svg|ttf|txt|vcard|vcf|webm|webmanifest|wasm|webp|woff|woff2|xml|xsl)$ dontlog
</IfModule>
CustomLog "logs/access_log" combined env=!dontlog
</IfModule>

<IfModule mime_module>
# Force UTF-8 for certain file types
AddCharset utf-8 .css .js .json .jsonld .svg .vcard .vcf .vtt .webmanifest .xml .xsl
AddCharset utf-8 .css .js .json .mjs .jsonld .svg .vcard .vcf .vtt .webmanifest .xml .xsl

# Proper MIME type
# http://www.iana.org/assignments/media-types/application/font-sfnt
Expand All @@ -153,7 +153,7 @@ TraceEnable off
AddType image/x-icon ico
# Servers should use text/javascript for JavaScript resources
# https://html.spec.whatwg.org/multipage/scripting.html#scriptingLanguages
AddType text/javascript js
AddType text/javascript js mjs
AddType text/vtt vtt
AddType text/vcard vcard vcf
AddType video/mp4 mp4
Expand Down Expand Up @@ -266,7 +266,7 @@ TraceEnable off
# Header set Access-Control-Allow-Origin "*" env=IS_CORS
# </FilesMatch>
<FilesMatch \.(a?png|crx|css|eot|gif|ico|jpe?g|js|json|jsonld|mp4|oga|ogg|ogv|otf|pack|pdf|svg|ttf|txt|vcard|vcf|vtt|wasm|webm|webmanifest|webp|woff|woff2|xml|xsl)$>
<FilesMatch \.(a?png|crx|css|eot|gif|ico|jpe?g|json|jsonld|m?js|mp4|oga|ogg|ogv|otf|pack|pdf|svg|ttf|txt|vcard|vcf|vtt|wasm|webm|webmanifest|webp|woff|woff2|xml|xsl)$>
# Do not revalidate until cache expired https://www.keycdn.com/blog/cache-control-immutable/
Header append Cache-Control immutable
Expand All @@ -277,7 +277,7 @@ TraceEnable off
Header unset msapplication-config env=edge
</FilesMatch>
</IfModule>
<FilesMatch \.(css|js)$>
<FilesMatch \.(css|m?js)$>
# Prevent MIME-sniffing to "script" and "style" types https://docs.microsoft.com/en-us/previous-versions/windows/internet-explorer/ie-developer/compatibility/gg622941(v=vs.85)
Header set X-Content-Type-Options nosniff
</FilesMatch>
Expand Down Expand Up @@ -311,7 +311,7 @@ TraceEnable off
ExpiresByType text/html "access plus 1 week"
</IfModule>
</FilesMatch>
<FilesMatch \.(css|js|json|jsonld|txt|xml|xsl)$>
<FilesMatch \.(css|json|jsonld|m?js|txt|xml|xsl)$>
# Do not show a snippet in the search results for this files
# CSS and JS files must stay indexable/crawlable in order to allow search engines to render the pages like a modern browser https://webmasters.googleblog.com/2014/05/understanding-web-pages-better.html
Header set X-Robots-Tag nosnippet
Expand Down

0 comments on commit f3b7136

Please sign in to comment.