-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
component cards have fallback rendering
- Loading branch information
Showing
4 changed files
with
67 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,52 @@ | ||
/* jshint node: true */ | ||
'use strict'; | ||
var MergeTrees = require('broccoli-merge-trees'); | ||
var Funnel = require('broccoli-funnel'); | ||
var path = require('path'); | ||
|
||
function distDirFor(packageName) { | ||
var resolved = require.resolve(packageName + '/package.json'); | ||
if (resolved) { | ||
return path.join(path.dirname(resolved), 'dist'); | ||
} else { | ||
return null; | ||
} | ||
} | ||
|
||
module.exports = { | ||
name: 'ember-mobiledoc-editor', | ||
|
||
treeForVendor: function() { | ||
var distDir = path.join( | ||
path.dirname(require.resolve('mobiledoc-kit/package.json')), | ||
'dist' | ||
); | ||
var files = []; | ||
|
||
var files = new Funnel(distDir, { | ||
files.push(new Funnel(distDirFor('mobiledoc-kit'), { | ||
files: [ | ||
'css/mobiledoc-kit.css', | ||
'global/mobiledoc-kit.js', | ||
'global/mobiledoc-kit.map' | ||
], | ||
destDir: 'mobiledoc-kit' | ||
}); | ||
return files; | ||
})); | ||
|
||
var rendererDir = distDirFor('mobiledoc-dom-renderer'); | ||
if (rendererDir) { | ||
files.push(new Funnel(rendererDir, { | ||
files: [ | ||
'global/mobiledoc-dom-renderer.js' | ||
], | ||
destDir: 'mobiledoc-dom-renderer' | ||
})); | ||
} | ||
|
||
return new MergeTrees(files); | ||
}, | ||
|
||
included: function(app) { | ||
app.import('vendor/mobiledoc-kit/css/mobiledoc-kit.css'); | ||
app.import('vendor/mobiledoc-kit/global/mobiledoc-kit.js'); | ||
var rendererDir = distDirFor('mobiledoc-dom-renderer'); | ||
if (rendererDir) { | ||
app.import('vendor/mobiledoc-dom-renderer/global/mobiledoc-dom-renderer.js'); | ||
} | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters