tactivos / grunt-htmlrefs

Replaces (or removes) references to non-optimized scripts or stylesheets on HTML files
27 stars 14 forks source link

RequireJS support #14

Open PunkChameleon opened 11 years ago

PunkChameleon commented 11 years ago

Hey there,

Great plugin -- it's really be a good experience working with this.

However, the main reason I'm using it is to replace an old requireJS tag with a new one. RequireJS tags look like this:

<script data-main="script/to/run/first" src="path/to/require.js"></script>

Basically, I would like to replace 'data-main' with the path to my newly minified file. Is there any way to support this?

johnnyhalife commented 11 years ago

Sure there's , you can take a look at the code and send a pull request if it works we'll integrate :smile:

cedmax commented 11 years ago

I did it like this, it's not beautiful, but it does the trick

<!-- build:js js/lib/require.js" data-main="js/main.<%= version %>.js -->
<script src="js/lib/require.js" data-main="js/main.js"></script>
<!-- endbuild -->