How can I set up Express to use style.scss file instead of style.sass ?
It only recognizes style.sass with the following configuration.
app.js
// Sass setup
app.use(require('node-sass-middleware')({
src: path.join(__dirname, 'public/sass'),
dest: path.join(__dirname, 'public/css'),
indentedSyntax: true,
sourceMap: true,
outputStyle: 'compressed'
}));
Structure tree
-public
--stylesheets
---style.css
---style.css.map
---style.sass
I would like to use style.scss instead of style.sass.
If you want to use scss files, you can remove the key/value intentedSyntax. This option allows you to use scss files
app.use(require('node-sass-middleware')({
src: path.join(__dirname, 'public/sass'),
dest: path.join(__dirname, 'public/css'),
sourceMap: true,
outputStyle: 'compressed'
}));
However, say if you used indentedSyntax but wanted to use the file extension scss - then you'll have to make a decision.
.sass).scss and ensure you have brackets in your scss files.If you're using sass 3.x then you can use the above proposed solution.