/es-modules

Primary LanguageJavaScript

es-modules

  • Module System for JavaScript 🎉

Currently:

  • Bunch of parts to construct a complex
  • jQuery, eg: <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
  • $( "button.continue" ).html( "Next Step..." )
  • Use webpack to bundle multiple files into 1 file

Native ES Modules:

  • Defer by default (doesnt block html parser by default)
  • Modules are fetched with CORS, so follow same security rules
  • Can use nomodule for fallback on other browsers: <script nomodule src="fallback.js"></script>

Can we use it?