angular - Webpack - Unable to find loader for SASS/SCSS -
i error message of:
error in ./src/assets/css/site.scss module parse failed: c:\_code\vscode\angular2-webpack-starter\src\assets\css\site.scss unexpected character '@' (1:0) may need appropriate loader handle file type. | @import "_variables.scss"; | @import "_helpers.scss"; | html { @ ./src/app/app.component.ts 5:0-34 @ ./src/app/app.module.ts module: { loaders: [ { test: /\.woff(\?v=\d+\.\d+\.\d+)?$/, loader: "url?limit=10000&minetype=application/font-woff" }, { test: /\.woff2(\?v=\d+\.\d+\.\d+)?$/, loader: "url?limit=10000&minetype=application/font-woff" }, { test: /\.ttf(\?v=\d+\.\d+\.\d+)?$/, loader: "url?limit=10000&minetype=application/octet-stream" }, { test: /\.eot(\?v=\d+\.\d+\.\d+)?$/, loader: "file" }, { test: /\.svg(\?v=\d+\.\d+\.\d+)?$/, loader: "url?limit=10000&minetype=image/svg+xml" },{ test: /\.sass$/, loaders: ["style", "css", "sass"] } ,{ test: /\.scss$/, loaders: ["style", "css", "sass"] }], rules:[...] //other random code webpack starter kit };
the code below works correctly
//works require("!style-loader!css-loader!sass-loader!../assets/css/site.scss"); //doesn't work require('../assets/css/site.scss');
already tried following config options
{test: /\.scss$/, loaders: ["style-loader", "css-loader", "sass-loader"]} loaders: ["style", "css", "sass"] loader: '!style-loader!css-loader!sass-loader!' loader: 'style-loader!css-loader!sass-loader'
i want load webpack config, doesn't seem working. project practically entire of angular 2 webpack starter.
the correct packages installed dependencies , i've read tutorials , every solution can find on google.
this i'm using , works :
{ test: /\.scss$/, use: ['to-string-loader', 'css-loader', 'sass-loader'] },
and install
"style-loader "to-string-loader "sass-loader "node-sass "css-loader
Comments
Post a Comment