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

Is it possible to load the JSON file using inline loaders? #45

Open
thisischrisj opened this issue Feb 20, 2021 · 1 comment
Open

Is it possible to load the JSON file using inline loaders? #45

thisischrisj opened this issue Feb 20, 2021 · 1 comment

Comments

@thisischrisj
Copy link

The documented config means that the scssVars.json file would be included for every loaded SCSS file and always at the start.

Is there a way to declare the loader inline so you can control when and where it is imported? So something like:

sass1.scss

@import "./fileA.scss";
@import "./fileA.scss";

sass2.scss

@import "./fileC.scss";
@import "@epegzz/sass-vars-loader!variables.json";
@import "./fileD.scss";

In this instance sass1.scss would not have access to the variables.json file. However sass2.scss will and the declarations will be made after fileC but before fileD is imported.

I'm not actually sure whether it's possible to use inline-loaders through the SCSS import statement. I'm curious to know if it's possible or if there is a way to make it possible.

@epegzz
Copy link
Owner

epegzz commented Apr 4, 2021

Hey @thisischrisj 👋

Good question. I have no idea if inlining would work. Also, it's been a while since I used this loader myself TBH 😅

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