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

AssetRewrite.rewriteAssetPath incorrectly matching remote file paths containing the same name as a valid rewrite #24

Open
trabus opened this issue Sep 1, 2015 · 3 comments

Comments

@trabus
Copy link

trabus commented Sep 1, 2015

As described in this S.O. issue, if there is a remote file path that contains the same filename as another file that is a valid rewrite (an actual asset path that should be rewritten), the rewriteAssetPath method is processing those paths even though they're to a remote path.

For instance, in a project named coolapp:

model: function() {
  // this path is being rewritten because it's matching `coolapp` but not taking into account that it's from a remote path
  return Ember.$.getJSON('http://my.remote.url.com/coolapp.json');
}

I imagine this probably just needs some adjustments to the regex to prevent matching remote paths.

@rickharrison
Copy link
Collaborator

This is unfortunately a pretty complex problem to solve. Any help with failing test cases, etc. would be much appreciated.

@trabus
Copy link
Author

trabus commented Sep 1, 2015

I'll try to throw together a test case, and maybe even take a crack at it later tonight. I'm doing something similar with ember-cli-mv, but I'm walking the AST for each file and updating paths there (currently just doing a regex as well).

@mcfiredrill
Copy link

@trabus thanks for reporting this!

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

3 participants