JSFiddle - React, Tailwind, and code Playground
HTML
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<title>Import maps without Rails - Local-time example</title>
<script async src="https://unpkg.com/es-module-shims@1.2.0/dist/es-module-shims.js"></script>
<script type="importmap-shim">
{
"imports": {
"local-time": "https://ga.jspm.io/npm:local-time@2.1.0/app/assets/javascripts/local-time.js"
}
}
</script>
<script type="module-shim">
import LocalTime from "local-time"
LocalTime.start()
</script>
<style>
time { color: #c11; font-size: 1.1em; }
</style>
</head>
<body>
<h1>Import maps without Rails - Local-time JS example</h1>
<p>
Last time I had chocolate was <time datetime="2022-05-08T23:00:00+02:00" data-local="time-ago">8th of May</time>
</p>
</body>
</html>