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

Need way to change something in the root path #358

Closed
pbakaus opened this issue Mar 15, 2017 · 4 comments · Fixed by #414
Closed

Need way to change something in the root path #358

pbakaus opened this issue Mar 15, 2017 · 4 comments · Fixed by #414
Assignees

Comments

@pbakaus
Copy link

pbakaus commented Mar 15, 2017

Library Affected:
sw-build

Browser & Platform:
all browsers

Issue or Feature Request Description:
My server maps /assets to /static and so I need a way to replace assets with static. rootDirectory doesn't work as it only accepts actual paths that exist.

@jeffposnick
Copy link
Contributor

Cf. replacePrefix in sw-precache.

@devnook
Copy link

devnook commented Mar 23, 2017

+1

@gauntface
Copy link

cc @jeffposnick @addyosmani

Using names from this suggestion, modifyUrlPrefix seems like a better name than replacePrefix, stripPrefix and stringPrefixMulti.

modifyUrlPrefix: {
  '/assets': '/static',
  '/dist/app': ''
}

Replace prefix is dropped and forces developer to define an empty string, stripPrefix and stringPrefixMulti are just morphed into the key value approach above.

@addyosmani
Copy link
Member

I'm strongly in favor of just implementing modifyUrlPrefix instead of the trio of original versions of this from sw-precache. Looking at GitHub codesearch, usage of the older versions is low/not there and I don't see this breaking a huge number of folks. Having a migration path for the few that do need this should be sufficient.

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

Successfully merging a pull request may close this issue.

5 participants