-
Notifications
You must be signed in to change notification settings - Fork 323
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
@imports don't work behind a proxy #612
Comments
You may need to specify some proxy options, see: the |
@crowne did you have a chance to give it a try again? |
Hi Jakub, Thanks for the inliner, I've manged to get it working by passing the following options to the gulp-minify-css constructor, which passes it on to clean-css.
|
Thanks @crowne for giving it a try and coming back with a working solution. I've just updated the readme pointing to this use case - https://github.com/jakubpawlowicz/clean-css#how-to-use-clean-css-programmatically As a matter of fact I think clean-css should prefill |
Hi Jakub, I like that idea, luckily I have only one external import. If clean-css could analyze each import URL and set the properties accordingly then that would be useful, especially for those executing behind a proxy. |
👍 let's stage it for 3.4 |
So we infer proxy settings either from inliner.proxy.hostname or HTTP_PROXY environment variable now. |
It's just been released with clean-css 3.4. 🎆 |
This feature does not seem to be working. It is unable to correctly detect my proxy setup at work from the HTTP_PROXY environment variable. @crowne 's workaround works, but that kind of sucks because then I have to manually specify the path of every single remote import |
@RPGillespie6 could you please share your setup as described in https://github.com/jakubpawlowicz/clean-css/blob/master/CONTRIBUTING.md ? |
Sure:
test.js:
This is how I run it:
This does not work, and will generate a
Directly.
I am able to get it to work if I do the following:
Xubuntu Linux 32-bit Note that |
Not sure how related this is but I had to call the HTTP version of the fonts instead of the HTTPS version, otherwise Jenkins was blowing up on me with the @import error :( Probably a corporate proxy or port block issue. |
I think this is related; cleanCss is erroring out on my blessed files on the first import statement "Broken @import declaration"
|
This does appear to still be an issue. It appears that the automatic application of proxy settings doesn't work with https URLs. |
This is a piece of code (in master) responsible for setting up request - https://github.com/jakubpawlowicz/clean-css/blob/master/lib/reader/load-remote-resource.js#L17-L30 - any ideas how to make it work with HTTPS resources? |
Btw, please open a new issue for HTTPS resources. |
I'm using gulp-minify-css to minify a css comprised of bootswatch-spacelab + bootstrap + custom-stuff.
It compiles fine when I have direct internet access, however when I am behind the corporate proxy it fails with the error below.
npm, bower & curl all work OK behind the proxy, so the issue is not with my shell.
[17:06:14] Error: Broken @import declaration of "http://fonts.googleapis.com/css?family=Open+Sans:400italic,700italic,400,700" - timeout
at formatError (c:\Program Files\nodejs\node_modules\gulp\bin\gulp.js:169:10)
at Gulp. (c:\Program Files\nodejs\node_modules\gulp\bin\gulp.js:195:15)
at Gulp.emit (events.js:95:17)
at Gulp.Orchestrator._emitTaskDone (c:\Users\crowne\ws-enide\appdemo\appdemo-ui\node_modules\gulp\node_modules\orchestrator\index.js:264:8)
at c:\Users\crowne\ws-enide\appdemo\appdemo-ui\node_modules\gulp\node_modules\orchestrator\index.js:275:23
at finish (c:\Users\crowne\ws-enide\appdemo\appdemo-ui\node_modules\gulp\node_modules\orchestrator\lib\runTask.js:21:8)
at Stream. (c:\Users\crowne\ws-enide\appdemo\appdemo-ui\node_modules\gulp\node_modules\orchestrator\lib\runTask.js:52:4)
at Stream.f (c:\Users\crowne\ws-enide\appdemo\appdemo-ui\node_modules\gulp\node_modules\orchestrator\node_modules\end-of-stream\node_modules\once\once.js:17:25)
at Stream.emit (events.js:117:20)
at DestroyableTransform.onerror (c:\Users\crowne\ws-enide\appdemo\appdemo-ui\node_modules\lazypipe\node_modules\stream-combiner\index.js:36:18
)
The text was updated successfully, but these errors were encountered: