Skip to content

Commit

Permalink
Prepare for FastBoot 1.0.
Browse files Browse the repository at this point in the history
  • Loading branch information
kratiahuja committed Jun 18, 2017
1 parent f3cc1c7 commit 42c9585
Show file tree
Hide file tree
Showing 3 changed files with 180 additions and 196 deletions.
20 changes: 16 additions & 4 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,24 +1,36 @@
/* eslint-env node */
'use strict';

const fastbootTransform = require('fastboot-transform');

module.exports = {
name: 'ember-flatpickr',
options: {
nodeAssets: {
flatpickr() {
flatpickrJs: function() {
const localePaths = this.locales.map(locale => `l10n/${locale}.js`)

return {
enabled: !process.env.EMBER_CLI_FASTBOOT,
srcDir: 'dist',
import: [
'flatpickr.js',
'flatpickr.js'
].concat(localePaths),
processTree: function(input) {
return fastbootTransform(input);
}
};
},
flatpickCss: function() {
return {
srcDir: 'dist',
import: [
this.theme || 'flatpickr.css'
].concat(localePaths)
]
};
}
}
},

included(app) {
if (app.options && app.options.flatpickr && app.options.flatpickr.theme) {
this.theme = `themes/${app.options.flatpickr.theme}.css`;
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
"dependencies": {
"ember-cli-babel": "^6.0.0",
"ember-cli-node-assets": "^0.2.2",
"fastboot-transform": "^0.1.0",
"flatpickr": "^3.0.5-1"
},
"devDependencies": {
Expand Down
Loading

0 comments on commit 42c9585

Please sign in to comment.