Reputation: 416
Using GruntJS, is it possible to replace certain resources in an HTML file with a remote path (or perhaps just anypath)? I'm particularly interested in doing this with the usemin plugin.
Possible sample functionality:
<!-- build:js //cdnjs.cloudflare.com/ajax/libs/angular.js/1.1.3/angular.js -->
<script src="/lib/angular.js"></script>
<!-- endbuild -->
<script src="//cdnjs.cloudflare.com/ajax/libs/angular.js/1.1.3/angular.js"></script>
This idea is very similar to what the usemin plugin does but it skips the concatenation of the enclosed resources into a new file of the specified name. In other words, it replaces all the enclosed HTML with a single resource of the specified path.
Upvotes: 2
Views: 2057
Reputation: 51
grunt-applymin is an alternative project for grunt-usemin: https://github.com/ghosert/grunt-applymin
Upvotes: 1
Reputation: 21
I wrote grunt-dom-munger because I found usemin too specific. You can use grunt-dom-munger to alter your HTML however you see fit and also to read your script tags and send those to concat/uglify/etc.
Upvotes: 2