Skip to content

Instantly share code, notes, and snippets.

@raido
Last active January 26, 2021 01:21
Show Gist options
  • Save raido/87a461b896f9281ed574 to your computer and use it in GitHub Desktop.
Save raido/87a461b896f9281ed574 to your computer and use it in GitHub Desktop.
Ember Addon treeForPublic, so included assets from addon would not be namespaced.
/* jshint node: true */
'use strict';
var Funnel = require('broccoli-funnel');
var mergeTrees = require('broccoli-merge-trees');
module.exports = {
name: '<your addon>',
/**
* Override default implementation for treeForPublic, because we want non namespaced assets
*
* @see https://github.com/ember-cli/ember-cli/blob/master/ADDON_HOOKS.md#treefor-cont
*/
treeForPublic: function(tree) {
var assetsTree = new Funnel('public');
return mergeTrees([tree, assetsTree], {
overwrite: true
});
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment