I am writing a Typescript file that has this import statement:
import Sortable from "sortablejs";
I then encountered the following error when I run the web app:
Failed to resolve module specifier "sortablejs". Relative references must start with either "/", "./", or "../".
To solve it, in my Razor page, I included the following code:
<script type="importmap">
{
"imports": {
"sortablejs": "https://cdn.skypack.dev/[email protected]"
}
}
</script>
It works fine but I read that importmap
is not supported by Safari. Thus, I am looking for an alternative solution.
Presently I am using WebOptimizer
to bundle my files and I would like to continue using that instead of Webpack
or others.