Skip to content

Is it possible to make this work without npm but with importmap #2135

Answered by camertron
troptropcontent asked this question in Q&A
Discussion options

You must be logged in to vote

Hey @troptropcontent, interesting question! I have personally never used import maps before, but after reading a bit about them I think primer/view-components should work with them. Try putting something like this in config/importmap.rb:

pin "@primer/view-components", to: "https://ga.jspm.io/npm:@primer/view-components@0.3.1/app/assets/javascripts/primer_view_components.js"

As for the CSS from primer/view-components and primer/css, you should be able to pull them in directly using <link> tags:

<link rel="stylesheet" href="https://unpkg.com/@primer/view-components@0.3.1/app/assets/styles/primer_view_components.css" crossorigin="" />
<link rel="stylesheet" href="https://unpkg.com/@primer/cs…

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@troptropcontent
Comment options

@camertron
Comment options

@troptropcontent
Comment options

@camertron
Comment options

Answer selected by lesliecdubs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants