In my project, I need to combine stylesheets that were written in 2 different preprocessor languages (SASS and Stylus) into one css file.
My naïve approach was to just add stylus-loader
with a test for the .styl
extension into my webpack config, and @import
a stylus file from my app.scss
file (which is the entrypoint).
It seems that sass-loader
doesn't resolve modules like it happens in JavaScript. I also tried making an entrypoint CSS file with my app.scss
and the Stylus file as imports, which also doesn't work.
Is this just a configuration I'm missing or do css-loader and sass-loader just not support this kind of module resolve?
Entry CSS
@import "sass-loader!./app.scss";
@import "stylus-loader!../node_modules/vuetify/src/stylus/main.styl
This will just result in this error:
ERROR in ./node_modules/css-loader??ref--6-1!./css/app.css
Module not found: Error: Can't resolve './sass' in '/Users/tux/projects/zenner/platform-base/platform/assets/css'
@ ./node_modules/css-loader??ref--6-1!./css/app.css 3:10-95
ERROR in ./node_modules/css-loader??ref--6-1!./css/app.css
Module not found: Error: Can't resolve './stylus' in '/Users/tux/projects/zenner/platform-base/platform/assets/css'
@ ./node_modules/css-loader??ref--6-1!./css/app.css 4:10-131