My app.scss
.tes {
color: red;
}
The output error when I execute ./node_modules/.bin/webpack
ERROR in ./~/css-loader!./~/sass-loader?indentedSyntax!./www/assets/app.scss
Module build failed:
.tes {
^
Invalid CSS after ".tes {": expected "}", was "{"
in ./www/assets/app.scss (line 1, column 7)
@ ./www/assets/app.scss 4:14-135 13:2-17:4 13:2-17:4 14:20-141
My webpack.config
module: {
loaders: [
{
test: /\.scss$/,
loader: 'style!css!sass?indentedSyntax'
},
{
test: /\.css$/,
loader: 'style!css'
}, {
test: /\.(woff|woff2|ttf|eot|svg)(\?]?.*)?$/,
loader: 'file-loader?name=res/[name].[ext]?[hash]'
}
]
},
And my app.js
require('./www/assets/app.scss');
var angular = require('angular');
var uiRouter = require('angular-ui-router');
require('velocity-animate');
require('node-lumx');
var HomeController = require('./www/components/home/homeController');
angular.module('app', ['lumx', uiRouter])
... //OMITED
Try using sass loader without the option "indentedSyntax" as 'style!css!sass'
More info you can read the docs here: http://sass-lang.com/documentation/file.INDENTED_SYNTAX.html
The solution would be to change your file extension to sass if you want to use sass syntax because as of version 3.2.0, sass-loader will derive the style you want to use from the file extension. It worked for me.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With