Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resolver can't import stylesheets from URLs #555

Open
WillsonSmith opened this issue Aug 4, 2023 · 2 comments · May be fixed by #880
Open

Resolver can't import stylesheets from URLs #555

WillsonSmith opened this issue Aug 4, 2023 · 2 comments · May be fixed by #880

Comments

@WillsonSmith
Copy link

WillsonSmith commented Aug 4, 2023

Possibly related to #479

I'm attempting to import a Google fonts stylesheet with the following

@import url('https://fonts.googleapis.com/css2?family=Lilita+One&display=swap');

The bundler throws with

SyntaxError: No such file or directory (os error 2)
...
loc: { line: 1, column: 1 },
data: 'ResolverError'

I'm using bundle to bundle this file.

Expected result:
Imports from URLs should probably remain as urls and not bundle the code.

Version:

"lightningcss": "^1.21.5"
@etdr
Copy link

etdr commented Aug 13, 2023

I can't find any documentation to tell if this is like, intended behavior or not. Should I not be using @import url(...) to load (e.g.) fonts from a CDN anyway?

@julientaq
Copy link

Did someone found a way for this? The only way out i found is to make a local copy of the url i’m calling on the outside.

I would assume that any css called from a http url is most likely to be a cdn content.

I would says: if the import is local, bundle it, otherwise keep it as it is. Would that be an acceptable behavior?

@sapphi-red sapphi-red linked a pull request Dec 27, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants