In embroider, the postprocessTree hook is not ran with the type of 'all'. Additionally, addons should deliver their assets with the addon's code instead of hoisting it to the application's build via a shared in-memory reference. I tried to return the assets in this addon's treeForPublic to better simulate how assets are normally delivered to the application from an addon, this worked in vanilla ember-cli, but in embroider the tree returned from treeForPublic is eagerly built causing it to be built before the stylesheet preprocessor runs. Fortunately, in embroider, I can return assets from the preprocessor tree (this doesn't work in some versions of ember-cli). As such, I had to conditionally branch on whether the application is being built with embroider to get this to work in both modes.
In embroider, the
postprocessTree
hook is not ran with the type of'all'
. Additionally, addons should deliver their assets with the addon's code instead of hoisting it to the application's build via a shared in-memory reference. I tried to return the assets in this addon'streeForPublic
to better simulate how assets are normally delivered to the application from an addon, this worked in vanilla ember-cli, but in embroider the tree returned fromtreeForPublic
is eagerly built causing it to be built before the stylesheet preprocessor runs. Fortunately, in embroider, I can return assets from the preprocessor tree (this doesn't work in some versions of ember-cli). As such, I had to conditionally branch on whether the application is being built with embroider to get this to work in both modes.