Can I use dust.js as a preprocessor for css and js? Is there any side effects of doing so?

StackOverflow https://stackoverflow.com/questions/20659693

  •  19-09-2022
  •  | 
  •  

Question

since we are using dust.js to write templates, we have extended it to write css and js. For css and js our requirement is minimal. We just want to keep the location of assets in a variable which is passed to css and js during preprocessor stage. I tested it in all possible scenarios and it worked. Is there any side effect of using it this way?

I am not using less or sass because our requirement is very limited.

Was it helpful?

Solution

In the end, dust.js is just a text parser-- it doesn't care what sort of text you throw at it.

You should be careful to configure whitespace suppression if you are using dust to parse a whitespace-sensitive language like Javascript (newlines are very important for meaning in Javascript due to one-line comments and automatic semicolon insertion). For CSS, whitespace has no effect.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top