Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does watch work with Jade?

Tags:

node.js

pug

I want to watch my jade files and compile them, but it appears it does not work

jade client/jade --watch --out public

When I change client/jade/draft.jade it does not re-compile. I saw a post, saying it does not work with directories? Is it not fixed yet? Is there a workaround or something? Must I watch all files manually?

https://groups.google.com/d/msg/jadejs/p_slRuISjVg/lL_uxgD6uB0J

like image 347
Jiew Meng Avatar asked Aug 17 '12 12:08

Jiew Meng


People also ask

Is it OK to buy jade for yourself?

Can you buy the jade for yourself and still have luck? Yes, however the Maori people believe you have more luck if you are given a piece of Jade as a gift.

Can jade be worn everyday?

Once the [molecular] structure of the jade is broken with chemicals, it's considered fake jade. Let's not even talk about bad luck; it's harmful to wear these jade pieces simply 'cos they're coated in acid. If you wear it on your skin every day, it will harm you.

What wrist should I wear my jade bracelet?

A jade bangle can either be worn on the right hand or the left hand. Many individuals opt to wear it on their left wrist because it is closer to the heart and is the traditional way for the stone to achieve wellness and balance throughout the body.

Is wearing jade good luck?

Jade is believed to bring luck. Just like a four-leaf clover is considered a symbol of good fortune, jade is thought to have protective, lucky-charm energy. That's why you'll often see jade statues used in feng shui, and why babies in Asian cultures are often gifted jade bracelets when they're born.


1 Answers

What you have now says "watch the directory for changes". If you add or remove a file from the directory, it will recompile all the files. However, because it is only watching the directory (which is really just a file itself) and not the files in the directory, changing one of the files will not trigger a compile.

To watch all jade files in client/jade

$ jade --watch client/jade/*.jade --out public

This doesn't truly watch the directory, it just expands the jade command to watch all jade files present when you start, rather than having to type them all out. If you add a file after beginning the watch, then you'll need to restart it.

like image 183
zackdever Avatar answered Sep 22 '22 20:09

zackdever