mercredi 17 juin 2015

Move Entire Folder using Broccoli JS in Ember CLI Project

I am developing an ember-cli project and I am working on a system that allows me to resolve templates that have not been loaded and may possibly live outside of the project structure.

I would like to have a folder in my dist/assets directory called templates and inside that folder would be all the pre compiled templates from app/templates/external. This is my current Brocfile.js attempt with broccoli stew

var EmberApp = require('ember-cli/lib/broccoli/ember-app');
var stew = require("broccoli-stew");

var app = new EmberApp({
  vendorFiles: {
    "jquery.js": null
  },
  sassOptions: {
      includePaths: [
        'bower_components/bourbon/app/assets/stylesheets/',
        'bower_components/neat/app/assets/stylesheets/',
        'bower_components/bitters/app/assets/stylesheets/'
      ]
    }
});

var additionalTrees = [];

var templateFiles = stew.find(appTree, "assets/app/templates/external");
templateFiles = stew.mv(templateFiles, "assets/app/templates/external", "assets/templates");
additionalTrees.push(templateFiles);

module.exports = app.toTree(additionalTrees);

Aucun commentaire:

Enregistrer un commentaire