I have an addon which needs to copy a set of JS files from their bower directory to the Ember app's root of /dist (this is for scoping rules associated with service workers). I thought maybe I could use the treeForApp hook but while I'm getting no errors I'm also not getting the desired result.
The index.js is:
const Funnel = require('broccoli-funnel');
module.exports = {
name: 'ember-upup',
treeForApp: function(tree) {
tree = new Funnel(tree, { include:
[
'bower_components/upup/dist/upup.min.js',
'bower_components/upup/dist/upup.sw.min.js'
]});
return this._super.treeForApp.call(this, tree);
},
Note: I thought I might be able to solve this problem by simply copying the javascript files as part of
index.jspostBuild hook but while this DOES put the JS files into the dist folder's root it is not served by ember-cli'sember serveapparently if not pushed through one of it's build pipelines.Stefan Penner has now pointed out the the
distdirectory is for developers to look at but serving is actually done within thetmpdirectory structure ... this explains why my "hack" didn't work.