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

assetMap is rewritten if "json" is in replaceExtensions #91

Open
tomdale opened this issue Feb 17, 2016 · 3 comments
Open

assetMap is rewritten if "json" is in replaceExtensions #91

tomdale opened this issue Feb 17, 2016 · 3 comments

Comments

@tomdale
Copy link

tomdale commented Feb 17, 2016

Just ran into a tough-to-debug issue with broccoli-asset-rev that was causing issues in FastBoot. FastBoot relies on the asset map to generate its own manifest file.

However, in one of the apps I'm working on, they had added json to the replaceExtensions array (which I'd guess may be fairly common). Unfortunately, the assetMap.json file is also rewritten.

In effect, that means that instead of:

{ assets: 
   { 'assets/module-whitelist.css': 'assets/module-whitelist-d41d8cd98f00b204e9800998ecf8427e.css',
     'assets/module-whitelist.js': 'assets/module-whitelist-b2b974ffee53efecae932353853cf83a.js',
     'assets/vendor.css': 'assets/vendor-d41d8cd98f00b204e9800998ecf8427e.css',
     'assets/vendor.js': 'assets/vendor-eb3d3e03fa845747687b14602e40e459.js' },
  prepend: 'http://cdn.example.com/' }

You instead get the prepended URL added to each path:

{ assets: 
   { 'http://cdn.example.com/assets/module-whitelist.css': 'assets/module-whitelist-d41d8cd98f00b204e9800998ecf8427e.css',
     'http://cdn.example.com/assets/module-whitelist.js': 'assets/module-whitelist-b2b974ffee53efecae932353853cf83a.js',
     'http://cdn.example.com/assets/vendor.css': 'assets/vendor-d41d8cd98f00b204e9800998ecf8427e.css',
     'http://cdn.example.com/assets/vendor.js': 'assets/vendor-eb3d3e03fa845747687b14602e40e459.js' },
  prepend: 'http://cdn.example.com/' }
@rickharrison
Copy link
Collaborator

Thanks for reporting. Can you add assetMap.json to the exclude property to fix this?

@tomdale
Copy link
Author

tomdale commented Feb 22, 2016

@rickharrison We just removed json from replaceExtensions since it was no longer needed (it was left over from using fixture data that had since been moved to talking to an API server). That's a good idea, though—and perhaps adding the assetMapPath to exclude by default could be a nice improvement.

@teddyzeenny
Copy link

teddyzeenny commented Dec 15, 2016

@rickharrison wouldn't adding assetMap.json to exclude only avoid fingerprinting the file itself but not the assets inside it? I'm able to use exclude to cancel files matched by the extensions option (they don't get fingerprinted themselves) but not the ones matched by replaceExtensions (the assets inside them still get fingerprinted).

[EDIT]: I noticed there's an ignore option for 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