• Jobs
  • About Us
  • professionals
    • Home
    • Jobs
    • Courses and challenges
  • business
    • Home
    • Post vacancy
    • Our process
    • Pricing
    • Assessments
    • Payroll
    • Blog
    • Sales
    • Salary Calculator

0

245
Views
How to use import maps with skypack and versions

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?

about 3 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Our process Sales
Legal
Terms and conditions Privacy policy
© 2025 PeakU Inc. All Rights Reserved.

Andres GPT

Recommend me some offers
I have an error