-
Notifications
You must be signed in to change notification settings - Fork 156
Scss integration #73
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
Scss integration #73
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work, thanks so much 😀
There's a couple things. First, we shouldn't add it as a peerdependency, because users that don't use scss won't need node-sass installed. Elsewhere we're using an ensureRequire
helper function that throws an error if it isn't installed—https://github.com/vuejs/vue-jest/blob/master/lib/compilers/coffee-compiler.js#L6. Can you remove node-sass as a peerDependency and use ensureRequire.
Secondly, could you move process-styles/index.js to lib/process-style.js. Then move process-style/stylus and process-style/scss to lib/compilers/stylus-compiler and lib/compilers/scss-compiler.
Third, why do we need to rewrite the imports in scss?
This is awesome though, and I'm looking forward to adding SCSS support 😀
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I forgot to click request changes in my previous review.
Also node-sass needs to be added as a devDependency so the tests can use it
you got it 👌 as for your question about rewriting imports, i've actually copied the functionality almost identically from sass-resources-loader. what we're doing is converting all the sass import paths to absolute paths (starting at the project root) because |
exclude scss from warning include node-sass as peer dependency
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work 😀
hi @eddyerburgh - thanks for your awesome contributions to the vue ecosystem
i've been needing an scss compiler with this package for a minute now, so i thought i'd go ahead and try adding it myself. to give you an overview of this PR, i
processStyle
function and moved it to its own modulescss
compiler (no support forsass
yet)scss
global files via jest global (as recommended here). the format of this feature is inspired by sass-resources-loaderwhat do you think?