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

Ignores all parameters (CSS/SASS/PostCSS) #51

Closed
strarsis opened this issue Jan 22, 2018 · 4 comments
Closed

Ignores all parameters (CSS/SASS/PostCSS) #51

strarsis opened this issue Jan 22, 2018 · 4 comments

Comments

@strarsis
Copy link

strarsis commented Jan 22, 2018

I am using SASS with PostCSS together with responsive-loader in a webpack setup.
The size parameter is ignored, always the original (max) size file used.

Example:

.test {
  background-image: url(../images/background.jpg?size=1600&quality=10);
}

parsedResourceQuery is empty for the files referenced from within the SCSS files.

@jstcki
Copy link
Contributor

jstcki commented Jan 23, 2018

Can you create a reproducible test case in a public repo or Gist?

@strarsis
Copy link
Author

strarsis commented Jan 23, 2018

@herrstucki: Yes, I prepared a sample: https://github.com/strarsis/sage/tree/responsive-loader-issue-51

$ git clone https://github.com/strarsis/sage
$ cd sage
$ git checkout responsive-loader-issue-51
$ nvm use lts/*

$ yarn/npm install
$ yarn/npm build

Check dist/ folder afterwards: A new file is generated (including hash) and referenced to from
within the styles, but this image still has the original dimensions, the size parameter is ignored.

@strarsis
Copy link
Author

strarsis commented Feb 26, 2018

Using keepQuery: true as option for resolve-url fixes the issue:

            { loader: 'resolve-url', options: { sourceMap: config.enabled.sourceMaps, keepQuery: true } },

Also in bholloway/resolve-url-loader#81 (comment)

@strarsis
Copy link
Author

strarsis commented Apr 6, 2019

@herrstucki: Just ran into this issue again (sage9 based theme),
it could help other devs if this is also mentioned in the README.

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

No branches or pull requests

2 participants