Loading min.js files Generated by TypeScript with Require

Topics: General
Jan 14, 2013 at 7:05 PM

I have a full aplication working with Typescript and RequireJs, it is working perfectly. I have now download WebEssentials and it is generating the minified script files. WebEssentials generates separated *.min.js files with the same name as the original script file.

How can I tell RequireJs to load my minified files instead of my original script files ?

Thanks in advance

Jan 20, 2013 at 6:10 AM

The only way I've found is to give RequireJS different names, i.e., "myapp.min" instead of "myapp". One of these days, if TS supports conditional compilation or some reasonable facsimile thereof, maybe that won't be necessary.

Jan 21, 2013 at 12:18 PM

The solution I have used is to copy the min files to another directory, change its names to the original file names, without the .min, and configure require to look at this new address.

I am sure this is not the best solution but it is the only one I know.

Thanks