Friday, 21 April 2017

Using Grunt to watch all files in my src directory and output to build

I'm completely new to Grunt and I want to use it in my next project.

What I want to do is, for example, to have the file at src/server.coffee to be compiled to build/server.js and the file at src/public/assets/css/global.less to be compiled to build/public/assets/css/global.css.

That means I want to keep the same file path after src, as well as the same name of every file, only changing its extension. I can do this manually for every file in my project but I'd really like Grunt to do this with every file in the src folder.

How can I get this done?



via gchiconi