ember.js - Correct way to import all assets from external library with Ember CLI -


i'm working on ember.js project , leverage slick carousel library. i've installed library via bower in project folder, , having difficulty importing project.

in ember-cli-build.js, i've added import statements follows:

app.import('bower_components/slick-carousel/slick/slick.css'); app.import('bower_components/slick-carousel/slick/slick-theme.css'); app.import('bower_components/slick-carousel/slick/slick.js'); 

the issue running rest of required assets not built , included in dist folder when build (fonts, assets, etc.), leading errors missing fonts , assets present in "bower_components/slick-carousel" folder, not in build of actual ember application.

edit: looks broccoli-funnel needed. issue resolved specifying source files 'bower_components' folder , pointing relative path 'dist' folder in ember-cli-build.js file.

as note: 'broccoli-static-compiler' plugin commonly referenced elsewhere solution deprecated, use of 'broccoli-funnel' recommended plugin.

broccoli-funnel ended being looking for. placing following inside of ember-cli-build.js, needed files placed in correct directory during build:

var funnel = require('broccoli-funnel'); var requiredassets = new funnel('bower_components/slick-carousel/slick/fonts', {       srcdir: '/',       include: ['**/*.*'],       destdir: '/assets/fonts' }); return app.totree([requiredassets]); 

Comments

Popular posts from this blog

ubuntu - PHP script to find files of certain extensions in a directory, returns populated array when run in browser, but empty array when run from terminal -

php - How can i create a user dashboard -

javascript - How to detect toggling of the fullscreen-toolbar in jQuery Mobile? -