Java Script MVC steal/buildjs - remove empty .js files

234 Views Asked by At

When I try to do build with steal/buildjs of Javascript MVC, envJS silently fail to compress and check JavaScript files for errors.

I read documentation for envJS and found there that if in some case you try to build empty .js files envJS will fail.

Obviously it is in my case, and later I founded some of empty .js files.

I need a way to add checking for empty .js and .ejs files before build.

What would be the most efficient way to do check for empty .js and .ejs when running steal/buildjs?

1

There are 1 best solutions below

0
On

I would use find:

find . -type f \( -name *.js -o -name *.ejs \) -size 0 -print 

Change -print to -delete when you're sure.