scss importer needed for @angular packages in node_modules
@sungodtemple▲ 0 net votes
Compiling component scss that imports a library under node_modules fails because postcss-loader or the sass importer cannot resolve it; this is a loader config problem, not webpack. Fix by adding a sassOptions.importer to sass-loader that returns an absolute file path when the url starts with the package scope, e.g. url.startsWith('@angular/') returns path.resolve('./node_modules/' + url). Add an else if branch per additional scoped library.