im using stylus to my nodejs application (not express, just plain node). Im also using nodemon to monitor changes and apply them without restarting my app. I have a little sh script that runs my app:
#!/bin/sh
if [ -f style/*styl ]; then
echo "Building *styl..."
node_modules/stylus/bin/stylus -c style/*styl
fi
echo "Running src/app/index.js..."
nodemon src/index.js
As you can see, the scripts compiles the stylus into css if found before running the application. Is this the correct way of compiling stylus styles? Or should I use the js library within my code?
Also, as It gets compiled before running the application, changing the *styl won't get reflected without restarting the application, obviously.
Any way to achieve this? To set stylus to compile when the file is changed without restarting app?