You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi there, first time I am trying to migrate to import maps using jspm, but it fails on my fontsource imports
$ jspm link frontend/index.html -o frontend/index.html
Error: No './300.css' exports subpath defined in https://ga.jspm.io/npm:@fontsource/[email protected]/ resolving @fontsource/comfortaa/300.css imported from file:///home/myhome/myproject/index.js., linking HTML file "./index.html"
The respective import is import "@fontsource/comfortaa/300.css"; and works totally well with npm and build with parcel.
What workaround exist to make this work with jspm?
The text was updated successfully, but these errors were encountered:
The issue here is that importing CSS files is not a standard, unless you use the with { type: 'css' } attribute.
We could add non-standard support for CSS imports to be supported as injecting the CSS into the page, the problem is that it's not clear who is responsible for the injection - the package being imported, or the package doing the importing.
Strictly speaking, on the importer side, because there is no with { type: 'css' } we don't strictly know we are importing CSS, unless we rely on the file extension, but even then you could have an exports map mapping an arbitrary path ./x.css: ./x.js or even ./x: ./x.css so this doesn't seem reliable.
On the exporter side, this might make more sense as the place to put it, but that would mean that every .css file would be exposed as a JS file that injects the CSS for that file, which seems like it would be very costly to me in having a weird rewriting across packages.
My personal preference would be the standard CSS import.... if libraries would ever get on board with it.
Hi there, first time I am trying to migrate to import maps using jspm, but it fails on my fontsource imports
The respective import is
import "@fontsource/comfortaa/300.css";
and works totally well with npm and build with parcel.What workaround exist to make this work with jspm?
The text was updated successfully, but these errors were encountered: