I have a Scripts folder, that includes all the .js files used in the project. Using the Ajax Minifier task, I generate .min.js files for each one. Depending on whether the application is running in debug or release mode, I include the original .js file, or the minified one.
The Scripts folder looks like this:
Scripts/script1.js
Scripts/script1.min.js // Outside the project, generated automatically on build
Scripts/script2.js
Scripts/script2.min.js // Outside the project, generated automatically on build
The .min.js files are outside the project (although in the same folder as the original files), and they are not copied into the destination folder when we publish the project.
I have no experience whatsoever using build tasks (well, apart from including the minifier task), so I would appreciate if anyone could advise me as to which would be the correct way to:
- Copy the .min.js files to the destination folder when I publish the app from Visual Studio.
- Delete / Not copy the original js files (this is not vital, but I'd rather not copy files that will not be used in the app).
Thanks,
Edit: From the responses, I see that I missed some details, and that maybe I'm looking for the wrong solution to the problem. I'll add the following details to the question:
- If possible, we'd rather not create copy scripts in the build process of the solution. Sure, we considered it, but we were using Web deployment projects up until now, and we'd rather start using the new Publish feature of VS2010 (which is supposed to replace these projects) than manually adding copy commands to the build task.
- The *.min.js files are not included in the project because they can't be in the Source control system (TFS at this moment). They are files generated during compilation, and it would be akin to including the 'bin' folder in the TFS (including the problems it would cause). Maybe we should create the min files in a different folder and treat it like 'bin'? (Is that even possible?)