Is there a way to use versioned skypack code with importmaps?
I am trying to import codemirror from skypack-cdn. I also want the file to work with the bundlers, like Babel, in the future. It would be very nice to avoid the excessive workflow that bundlers bring to this tiny project.
The imports in the javascript file that I would like to save from bundling looks like this
import {EditorView, basicSetup} from 'codemirror'
import {keymap} from '@codemirror/view'
import {indentWithTab} from '@codemirror/commands'
import {javascript} from '@codemirror/lang-javascript'
import {EditorState} from '@codemirror/state'
The working import map looks like this.
<script type="importmap">
{
"imports": {
"codemirror" : "https://cdn.skypack.dev/codemirror/",
"@codemirror/" : "https://cdn.skypack.dev/@codemirror/"
}
}
</script>
The problem arrises when I try to pin Codemirror to a specific version like so
<script type="importmap">
{
"imports": {
"codemirror" : "https://cdn.skypack.dev/codemirror@6.0.0/",
"@codemirror/" : "https://cdn.skypack.dev/@codemirror@6.0.0/"
}
}
</script>
The URL https://cdn.skypack.dev/@codemirror@6.0.0/commands
does not exist. The correct place to look would be https://cdn.skypack.dev/@codemirror/commands@6.0.0
Is there anyway to pin this to a particular version using the import maps?