Comments (19)
Is it possible you can do this this year? ;)
oh yeah, absolutely 👍
from sass-vars-loader.
@dschox file order is now respected in v6.0.0
. Thanks for your patience 👍
from sass-vars-loader.
Hm, this would actually not work, since the sass files always come first. That's a stupid design! 🙈 😆
I could change that. It's basically #23
from sass-vars-loader.
@epegzz I think a PR is out of my league :)
Is it possible you can do this this year? ;)
from sass-vars-loader.
@epegzz Any news on this? :)
from sass-vars-loader.
The year is not over yet! 😆
from sass-vars-loader.
So what you're basically saying is, that the @import '~@/assets/styles/...'
is not working?
from sass-vars-loader.
Ah, no, the imports are working, but the files don't see the vars from the sass-vars-loader
, right?
from sass-vars-loader.
Thank you for reply, @epegzz!
Ah, no, the imports are working, but the files don't see the vars from the
sass-vars-loader
, right?
Yes, it is! I think there is inproper loading order. But I am not sure.
from sass-vars-loader.
Basically what the sass-vars-loader
is doing, is converting this:
@import '~@/assets/styles/vars';
@import '~@/assets/styles/util';
@import '~@/assets/styles/func';
@import '~@/assets/styles/mixins';
@import '~@/assets/styles/colors';
to this:
$var1=value1
$var2=value2
...
@import '~@/assets/styles/vars';
@import '~@/assets/styles/util';
@import '~@/assets/styles/func';
@import '~@/assets/styles/mixins';
@import '~@/assets/styles/colors';
So, as far as I understand Sass, the code in the @imported files should have access to those global vars 🤔
from sass-vars-loader.
I'm not really familiar with the chainWebpack method. Could it be that the css
command is actually overwriting the results from sass-vars-loader
?
from sass-vars-loader.
What about putting the @imports in a .sass file and load it as part of the sass-vars-loader
?
const path = require('path');
module.exports = {
chainWebpack: (config) => {
const moduleTypes = ['vue-modules', 'vue', 'normal-modules', 'normal'];
moduleTypes.forEach(moduleType =>
config.module
.rule('scss')
.oneOf(moduleType)
.use('@epegzz/sass-vars-loader')
.loader('@epegzz/sass-vars-loader')
.options({
syntax: 'scss',
files: [
path.resolve(__dirname, 'src/assets/styles/contracts/variables.json'),
path.resolve(__dirname, 'src/assets/styles/contracts/icons.json'),
path.resolve(__dirname, 'src/assets/styles/imports.scss') // <---
],
})
)
}
}
from sass-vars-loader.
What about putting the @imports in a .sass file and load it as part of the
sass-vars-loader
?
I have tried it and have got error while parsing .scss
-file :(
from sass-vars-loader.
Could you please implement this? #23
I'm in the same boat. Changing the order manually inside node_modules works for me.
Thank You! :)
from sass-vars-loader.
@dschox unfortunately I'm really busy lately and won't have the time to work on this currently. But I'm happy to merge any incoming PR :)
from sass-vars-loader.
Thank You very much! And happy new year :)
from sass-vars-loader.
@epegzz I ran into the same issue and this works around the problem, thanks! 👍
from sass-vars-loader.
I think we can close this...
from sass-vars-loader.
Maybe a mention in the README to the alternative data
/prependData
option.
from sass-vars-loader.
Related Issues (20)
- Respect file order HOT 1
- Variable not getting to scss with web pack 3.11 in angular 5 HOT 5
- Typescript support HOT 1
- Leading zero in string gets removed HOT 14
- Missing dependencies in 4.1.0 HOT 1
- Broken as of version 4.3.0 HOT 6
- Can I use this for stylus or less ? HOT 2
- Module build failed with Vue-CLI HOT 14
- Improve documentation
- HRM doesn't work for variable files in symlinks or packages HOT 3
- Missing additional loader? Any help? HOT 1
- Assertion error on precommit hook HOT 3
- SyntaxError: Unexpected token ']', web pack HOT 3
- Color names in JSON keys are interpreted as color objects by SASS HOT 4
- Unable to pass version string to add inside css comment HOT 2
- Is it possible to load the JSON file using inline loaders? HOT 1
- Passing transformer function as option HOT 3
- SassError: Invalid CSS after "..., -apple-system": expected ":", was ", BlinkMacSystemFon" HOT 1
- Webpack 5 implimentation HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sass-vars-loader.