lee-houghton / dusterjs

Node script to watch & compile directory of dust.js templates
4 stars 4 forks source link

Compiling to the same folder deletes all files #5

Open deepblue08 opened 8 years ago

deepblue08 commented 8 years ago

If you run this command, it won't just compile your .dust files, but it will also destroy any js files that are currently in there. Very unexpected bahavior. Lost several days of KnockoutJS work.

duster --no-concat views views

asztal commented 8 years ago

Hi,

Sorry you lost your code. Hope there wasn't too much of it...

It's unfortunate but I'm not sure I see an easy way round it. Having the same input and output directory could be a valid scenario, if there aren't already JS files in the dust directory. The reason it overwrites the output files is that it assumes they are there from a previous compilation.

Honestly my recommendation is to consider using webpack (or something similar like browserify) with dustjs-linkedin-loader. It's robust, configurable and well-maintained.