3 ms·
> RequireJS can build into a single file for production - it's dead simple to set up. Really? My experience was that it was a nightmare. Now you have to mainta
by domenicd 14y ago
> RequireJS can build into a single file for production - it's dead simple to set up.
Really? My experience was that it was a nightmare. Now you have to maintain yet another massive JavaScript config file (in addition to your original runtime require config file---don't get me started on that thing).
Plus, having different code run in development versus production led to constant issues.
- randomguy7788 14y agoyou can actually use the same config file for the runtime and the build
- pseudobry 14y agoThat's right! And even use a query hook in your urls to switch between minified/bundled, un-minified/bundled, and un-minified/un-bundled versions of your code base! All with one config file. Just refresh.
- Bockit 14y agoI've had the opposite experience to you. It took a little while to understand what was going on but once I did, I set up a project template that I've been able to use in all projects with little in the way of changes. Dev with asynchronous loading and production with built file. The best thing about it is I use jade for my template language and it can be configured to precompile the jade in the bill step, allowing me to use jade in the browser on older browsers. Also as mentioned in a sibling comment I use the same config file for building and development. This isn't specific to requirejs but it was also possible to work it into the asset pipeline of my backend system so that in production it compiles, caches and serves the built file and in dev it uses the asynchronous loader. The only issue I've run into is the same as the flotr2 issue described in the post, which it sounds like there is an easy fix for ski look forward to trying it out.