Skip to content
This repository has been archived by the owner on Apr 20, 2018. It is now read-only.

Specify custom href|src patterns for useminPrepare #578

Open
yhuard opened this issue Aug 3, 2015 · 1 comment
Open

Specify custom href|src patterns for useminPrepare #578

yhuard opened this issue Aug 3, 2015 · 1 comment

Comments

@yhuard
Copy link

yhuard commented Aug 3, 2015

Hi,

It would be very useful to let developers specify their own href|src patterns for useminPrepare.

Currently the pattern is /(href|src)=["']([^'"]+)["']/ (https://github.com/yeoman/grunt-usemin/blob/master/lib/file.js#L102) but what if I want to use this plugin in a Java dev environment where I call my assets like this: <script type="text/javascript" src="<spring:url value="/resources/bower_components/jquery/dist/jquery.js" />"></script>?

Changing the line by the following code does the trick:

var asset = l.match(/(href|src)=['"]<spring:url value=['"]\/([^"']+)["'][^\>]+\/>['"]/);

That's why I suggest adding an optional parameter for useminPrepare which would let the user define the pattern to look for. Do you agree?

@gormus
Copy link

gormus commented Aug 5, 2015

+1

I would love to be able to process the manifest file name through filerev via useminPrepare.

<!doctype html>
<!-- build:manifest /my_app.appcache -->
<html class="no-js" lang="en" manifest="my_app.appcache">
<!-- endbuild -->
<head>
...

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants