Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Smarter regex or options needed for this case #11

Open
binarykitchen opened this issue Aug 7, 2014 · 1 comment
Open

Smarter regex or options needed for this case #11

binarykitchen opened this issue Aug 7, 2014 · 1 comment

Comments

@binarykitchen
Copy link
Contributor

For application-specific reasons I only store the file name and its subfolder in the revision file like this

{
  "logo.png": "logo-afc86ade.png",
  "wait/wait1.gif": "wait/wait1-e244a2fd-e244a2fd.gif",
  ...
}

for them images, in the CSS I have these lines:

background: url("/img/logo.png")
background-image: url("/img/wait/wait1.gif")

None of your gulp options and default regex won't support this.

I think we need another option to prepend a subfolder to the regex. In my case something like this:

        .pipe(fingerprint('/img/rev-manifest.json'), {
            prependToRegex: '/img/'
        }))

so that

background-image: url("/img/wait/wait1.gif")

becomes

background-image: url("/img/wait/wait1-e244a2fd-e244a2fd.gif")

Agree @vincentmac?

@binarykitchen
Copy link
Contributor Author

By the way, if I use these two options it works like I wanted it to be:

  base:   'img/',
  prefix: '/img/'

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

No branches or pull requests

1 participant