简体   繁体   中英

Emberjs: _instantiatedStack error using broccoli-funnel

I'm trying to copy my font-awesome fonts to my dist/fonts directory using this:

var fontFiles = funnel('bower_components/font-awesome/', {
    srcDir: 'fonts',
    destDir: 'fonts'
});
console.log(fontFiles);

module.exports = app.toTree(fontFiles);

return app.toTree();

Using the console.log I see this:

version: 1.13.1 { inputTree: 'bower_components/font-awesome/',
_includeFileCache: {}, _destinationPathCache: {}, srcDir: 'fonts', destDir: 'fonts', _instantiatedStack: 'Error\\n at new Funnel (/home/.......

I've changed around the src directory with no effect.

I ended up getting it to work with the code below:

var EmberApp = require('ember-cli/lib/broccoli/ember-app');
var funnel = require('ember-cli/node_modules/broccoli-funnel');

module.exports = function(defaults) {
    var app = new EmberApp(defaults, {
        // Any other options
    });


    app.import('bower_components/bootstrap/dist/js/bootstrap.js');


    var fontFiles = new funnel('bower_components/fontawesome/fonts', {
        srcDir: '/',
        destDir: 'fonts'
    });

    module.exports = fontFiles;

    return app.toTree(fontFiles);
};

or

var EmberApp = require('ember-cli/lib/broccoli/ember-app');
var funnel = require('ember-cli/node_modules/broccoli-funnel');
var mergeTrees = require('ember-cli/node_modules/broccoli-merge-trees');

module.exports = function(defaults) {
    var app = new EmberApp(defaults, {
        // Any other options
    });


    app.import('bower_components/bootstrap/dist/js/bootstrap.js');


    var fontFiles = new funnel('bower_components/fontawesome/fonts', {
        srcDir: '/',
        destDir: 'fonts'
    });

    var merged = mergeTrees([app.toTree(), fontFiles], {
        overwrite: true
    });

    return app.toTree(merged);
};

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM