I am working on a new in-repo addon, and I want to copy a file from the public tree to my own addon's namespace.
I've specified that my addon should run after broccoli-asset-rev, because the file I want is the assetMap.json file generated by this plugin.
I've been able to use treeForAddon to write new files to my own addon's namespace (which I can then import in my application code), but my question is, can I read from the currently-built public tree in this hook? Ideally I'd like to do something like this:
module.exports = {
  name: 'my-new-addon',
  treeForAddon() {
    let publicTree = this.getTreeFor('public'); // does something like this exist?
    let newTree;
    // Read assets/assetMap.json from the public tree, and
    // write it to a file called asset-map.json in newTree
    return this._super.treeForAddon.call(this, newTree);
  }
};
That would allow me to do the following in my Ember app code:
import assetMap from 'my-new-addon/asset-map';
Is it possible?
 
                        
Are you looking for
treeForPublic?https://ember-cli.com/api/classes/Addon.html#method_treeForPublic