volodymyr-lisniak / magento-2-gulp

Gulp for Magento 2. It works with core Magento styles (less) and structure. Uses default theme configs from dev/tools/grunt/configs/local-themes.js.
MIT License
41 stars 12 forks source link

Relative folder #12 #14

Closed elisei closed 4 years ago

volodymyr-lisniak commented 4 years ago

@elisei Can you provide a description for this PR? In what case do you have a situation with a path without pub/ folder?


Full path to the loader-1.gif (for example) https://hostname.loc/pub/static/version1584090826/frontend/<package>/<theme>/en_US/images/loader-1.gif

And the relative path is pub/static/version1584090826/frontend/<package>/<theme>/en_US/images/loader-1.gif because critical CSS styles is situated in the root of the site https://hostname.loc/

elisei commented 4 years ago

Sure, @bobmotor

When accessing, for example, https: //dev.localhost/women/tops-women.html (sample data) or even https: //dev.localhost/checkout/cart/ in addition the file path must not contain the "pub" being just "static / ..."

volodymyr-lisniak commented 4 years ago

Yeah, you are right. We have the wrong relative path for the different pages because of a different base path.

https://hostname.loc/men/pub/static/ !== https://hostname.loc/women/pub/static/

I think we can fix this with absolute path implementation.

It would be nice if you test this realization #15.

elisei commented 4 years ago

Hi @bobmotor

using "/pub" in urls is not correct. You need 2 calls to the same file when the css is loaded. In addition, the absolute path can cause problems for stores that do not use ssl in all requests (which is not my case).