Skip to content

Support for direct-to-browser ESM #225

@MagnusOxlund

Description

@MagnusOxlund

From the docs, it looks like the project installs in the browser's global namespace.

Are there any plans to distribute an ES module directly to browsers (without Node.js) that can be imported with an ES6 import declaration?

For instance:

<!DOCTYPE html>
<html lang="en">
<head>
  <link rel="modulepreload" href="https://path/to/HumanizeDuration.js">
  <script type="module">
    import humanizeDuration from 'https://path/to/HumanizeDuration.js';
    console.log(humanizeDuration(97320000));
  </script>
</head>
</html>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions