fast-sass-loader
fast-sass-loader copied to clipboard
@import sytax can not be correct resolved on Windows 10 System.
Description
When I use fast-sass-loader in react project. It was well on my Mac. But when I try run this project on Windows 10 device, it can not pass the compile.
The Webpack throw a error message about "Module build failed.... Error : Import file cannot be resolved : @import '~src/styles/vars.scss' "...


Code
webpack config:
...json
// webpack.config
"alias": {
"src": "./src" // ignore the short path, it will be resolved correctly.
}
@import '~src/styles.vars.scss';
Environment
- fast-sass-load: @1.5.0
- webpack 4.x
- windows 10
同样的问题
For me, replacing imports[i] with imports[i].replace(/\\/g, "/") at https://github.com/yibn2008/fast-sass-loader/blob/master/lib/index.js#L205 (parameter to loaderUtils.urlToRequest(...)) works as a dirty-fix.
I'm not gonna spend time to work out a clean solution for a PR though.