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

Critical css #17

Closed volodymyr-lisniak closed 4 years ago

volodymyr-lisniak commented 4 years ago

Hi, @elisei! Sorry for the late reply.

using "/pub" in urls is not correct. You need 2 calls to the same file when the css is loaded.

The browser will cache the image (for example) the first time it loads, so any subsequent use of the same image will be loaded from the cache instead of from the server. And I don't understand how to avoid pub/ if we have it in our static files path on each page.

In addition, the absolute path can cause problems for stores that do not use ssl in all requests (which is not my case).

I think we can move this config to local.js

module.exports = {
    hostname: 'hostname',
    generic: 'loc',
    useHttp2: true
};