Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use SCSS with Express ? (Node.js)

Is there any way to use SCSS with Express ?

I tried with :

app.use(express.compiler({ src: __dirname + '/public', enable: ['scss'] }));

But it gives me an error :

DEBUG: TypeError: Cannot read property 'match' of undefined

Thanks

like image 554
Unitech Avatar asked Oct 09 '22 19:10

Unitech


2 Answers

There is no way you can use it that way i.e. as a built in module. The author of ExpressJS himself said that it is not possible. I was having the same problem and found out that you either had to use SASS.js or LESS.
Refer this: https://github.com/visionmedia/express/issues/787
I recommend you to use Stylus!

like image 162
MT. Avatar answered Oct 13 '22 10:10

MT.


Take a look @ Node-sass -- NPM Package | Github

This is a wrapper around the C/C++ library libsass.

like image 24
Stephen Sprinkle Avatar answered Oct 13 '22 12:10

Stephen Sprinkle