File watchers to minify and merge JS files from multiple folders
I am trying to acomplish the following.
I have raw assets such as javacript source files in folder assets/js in aplication root. I also have folder public where should go minified files that will be loaded in application.
What i want is when i change my js files i want to IDE create minified versions of it, and then to merge those minified files into one in public folder.
I need two file watchers but don't know how to configure them.
I tried default options for YUI compressor and those build minified files in the same folder where source files are. But i can't manage to merge those files with file watcher.
I also created two scopes, one for souce JS files, and one for minified JS files.
I am not even sure. file watchers can do this. I am talking about multiple folders, and recursive scopes.
I would appreciate any help.
Please sign in to leave a comment.
Hello,
What do you mean by merge?
You can just modify the path in the arguments so minified files would be created in another directory.
Just remember that output paths to refresh should be changed too.
I mean that at the end i want all min files to be concatenated into one.
So i would have one HTTP request not dozen.
You can configure a separate file watcher like https://yui.github.io/yuicompressor/ or any other merge/compress tool that will watch for minified files and compress them.