-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
load shepherd.js lazily using ember-auto-import (#305)
* wip: load shepherd.js lazily using ember-auto-import * guard fastboot use ember-cli to import theme css * remove ember-cli-node-assets * rename fastboot variable * await addSteps promise to resolve * clarify usage. Throw an error when the start method is being invoked and shepherd has not been fully loaded * use node 8 for tests
- Loading branch information
1 parent
2c11fc2
commit a95b171
Showing
9 changed files
with
135 additions
and
88 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
module.exports = { | ||
root: true, | ||
parser: 'babel-eslint', | ||
parserOptions: { | ||
ecmaVersion: 2017, | ||
sourceType: 'module' | ||
|
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
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,36 +1,16 @@ | ||
'use strict'; | ||
|
||
const fastbootTransform = require('fastboot-transform'); | ||
|
||
module.exports = { | ||
name: require('./package').name, | ||
included(app) { | ||
if (app.options && app.options.shepherd && app.options.shepherd.theme) { | ||
this.theme = `dist/css/shepherd-theme-${app.options.shepherd.theme}.css`; | ||
app.import(`node_modules/shepherd.js/dist/css/shepherd-theme-${app.options.shepherd.theme}.css`); | ||
} | ||
|
||
this._super.included.apply(this, arguments); | ||
}, | ||
options: { | ||
nodeAssets: { | ||
'shepherd.js'() { | ||
const include = [ | ||
'dist/js/shepherd.js' | ||
]; | ||
|
||
if (this.theme) { | ||
include.push(this.theme); | ||
} | ||
|
||
return { | ||
import: { | ||
include, | ||
processTree(tree) { | ||
return fastbootTransform(tree); | ||
} | ||
} | ||
}; | ||
} | ||
babel: { | ||
plugins: [ require.resolve('ember-auto-import/babel-plugin') ] | ||
} | ||
} | ||
}; |
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
Oops, something went wrong.