-
Notifications
You must be signed in to change notification settings - Fork 115
Importing remote sources over HTTP(S) #184
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
Conversation
request requires a protocol to be present, but protocol-relative don't provide a protocol. Since we don't know about the parent file's protocol (http or https), we just set for http (which is questionable, but works for now). http://www.paulirish.com/2010/the-protocol-relative-url/
| stmt.uri = "http:" + stmt.uri | ||
| } | ||
| } | ||
| // skip non-html protocol base uri (protocol://url) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
non-http
|
@fallafeljan Can you make this feature inside resolver and loader without editing |
| { | ||
| "name": "postcss-import", | ||
| "version": "8.0.2", | ||
| "version": "8.0.3", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't do this too,
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1
|
Not without editing index.js at all, since all protocol-based imports are ignored by default. I'm looking into putting most feature code into resolver & loader and just change the protocol matching regex to pass http://, https:// and //. |
|
@fallafeljan Okay. We can not filter url in the next major release. |
|
@fallafeljan Can you choose something different of |
|
@TrySound sure, I'll just look for something with less deps – any recommendations? Pardon, what do you mean by "filter url"? Changing the index.js protocol filtering? |
|
@fallafeljan We can pass false in resolve function or maybe add some fitler option. |
|
So moving the protocol checking from |
|
@fallafeljan Not now. When we will be ready for major. Now just leave it. |
|
@TrySound I found your comment confusing. It's not a big deal to make a breaking change. |
|
@MoOx Yeah, I know. I just don't have a lot time on my new work for open source these days. Maybe next week. |
|
Ok no hurry, I just wanted to know if you were ok ;) |
|
If someone else needs this functionality, it could be found there: https://github.com/unlight/postcss-import-url |
|
Cool! So I am closing! |
Referencing #182. Added a small HTTP server (
test/helpers/fixture-server.js) to perform tests intest/remote.js. All passing so far!Edit: Argh, didn't know each commit shows up individually...