Skip to content

Apache Server ES6 modules

Nuno Luciano edited this page May 29, 2024 · 1 revision

You basically need to create a .htaccess file in your server root directory,
or extend your Apache config file with the following htaccess directive in order for the
server to output files with the.mjs extension with the correct MIME type:

Add mjs to text/javascript :

<IfModule mod_mime.c>
  AddType text/javascript js mjs
</IfModule>

For this to work, you need mod_mime to be installed and enabled on your server.