Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support data-type="module" to generate native <script type="module"> #11466

Merged
merged 1 commit into from May 24, 2020

Commits on Apr 22, 2020

  1. Support data-type="module" to generate native <script type="module">

    If you want to use your browser's native ES module support, the <script> tag
    needs to have a type="module" attribute. Now, babel standalone can generate
    native module scripts with <script type="text/babel" data-type="module">
    
    ```
    <!doctype html>
    <html>
    <head>
      <title>Babel Test</title>
    </head>
    <body>
      <script src="./babel.js"></script>
      <script type="text/babel" data-presets="react" data-type="module">
        /** @jsx h */
        import { h, render } from 'https://unpkg.com/preact?module';
        render(<h1>Hello World!</h1>, document.body);
      </script>
    </body>
    </html>
    ```
    dfabulich committed Apr 22, 2020
    Copy the full SHA
    7781348 View commit details
    Browse the repository at this point in the history