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

Allow data to be passed as sass option #216

Merged
merged 1 commit into from
Mar 3, 2016

Conversation

fahad19
Copy link
Contributor

@fahad19 fahad19 commented Feb 15, 2016

It's a very rare use case, but wanted to create a PR to find out if it's worthwhile making it to sass-loader too.

Why?

  • I used the sassOptions.data key to inject some dynamic Sass variables
  • node-sass itself allows data to be passed in sassOptions

But...

sass-loader overwrites sassOptions.data which means I can't do the variable injection any more.

Solution

Check if sassOptions.data is present first, and if yes, then prepend that before file content. Otherwise, just roll with the file content as normal.

jhnns added a commit that referenced this pull request Mar 3, 2016
Allow `data` to be passed as sass option
@jhnns jhnns merged commit 5af9717 into webpack-contrib:master Mar 3, 2016
@jhnns
Copy link
Member

jhnns commented Mar 3, 2016

Sounds good 👍
@mrfr0g: Is this a solution for #191?

@jhnns
Copy link
Member

jhnns commented Mar 12, 2016

Shipped with v3.2.0

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

Successfully merging this pull request may close these issues.

None yet

2 participants