Configuring hugo server to serve 'mjs' ES modules


[mediaTypes] [mediaTypes."text/javascript"] suffixes = ["js", "mjs"]


上記のコードでは、正しいMIMEタイプのESモジュール用のmjsファイルを提供できます(メモモジュールは 'text / javascript'で提供する必要があります)。これはローカルテストにのみ必要です。ホスティングは別の問題です:)

About Me: Paul Kinlan

I lead the Chrome Developer Relations team at Google.

We want people to have the best experience possible on the web without having to install a native app or produce content in a walled garden.

Our team tries to make it easier for developers to build on the web by supporting every Chrome release, creating great content to support developers on, contributing to MDN, helping to improve browser compatibility, and some of the best developer tools like Lighthouse, Workbox, Squoosh to name just a few.