UNPKG

841 BJavaScriptView Raw
1'use strict';
2
3const path = require('path');
4const resolve = require('resolve');
5const Funnel = require('broccoli-funnel');
6const mergeTrees = require('broccoli-merge-trees');
7
8module.exports = {
9 name: 'ember-introjs',
10
11 included(app) {
12 this._super.included(app);
13
14 app.import('vendor/ember-introjs/intro.min.js', {
15 using: [
16 { transformation: 'amd', as: 'intro-js' }
17 ]
18 });
19 app.import('vendor/ember-introjs/introjs.min.css');
20 },
21
22 introJsPath() {
23 return path.dirname(resolve.sync('intro.js', { basedir: __dirname }))
24 },
25
26 treeForVendor(tree) {
27 const introJsTree = new Funnel(this.introJsPath(), {
28 srcDir: 'minified',
29 destDir: 'ember-introjs',
30 files: ['intro.min.js', 'introjs.min.css']
31 });
32
33 return tree ? new mergeTrees([tree, introJsTree]) : introJsTree;
34 },
35};