Skip to content

feat(gen): move babel choice to script list #1154

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 12, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 6 additions & 14 deletions app/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,21 +92,13 @@ var AngularFullstackGenerator = yeoman.generators.Base.extend({
type: 'list',
name: 'script',
message: 'What would you like to write scripts with?',
choices: [ 'JavaScript', 'CoffeeScript'],
choices: [ 'JavaScript', 'JavaScript + Babel', 'CoffeeScript'],
filter: function( val ) {
var filterMap = {
return {
'JavaScript': 'js',
'JavaScript + Babel': 'babel',
'CoffeeScript': 'coffee'
};

return filterMap[val];
}
}, {
type: 'confirm',
name: 'babel',
message: 'Would you like to use Javascript ES6 in your client by preprocessing it with Babel?',
when: function (answers) {
return answers.script === 'js';
}[val];
}
}, {
type: 'list',
Expand Down Expand Up @@ -141,8 +133,8 @@ var AngularFullstackGenerator = yeoman.generators.Base.extend({
}
}], function (answers) {

this.filters.babel = !!answers.babel;
if(this.filters.babel){ this.filters.js = true; }
// also set 'js' to true if using babel
if(answers.script === 'babel') { this.filters.js = true; }
this.filters[answers.script] = true;
this.filters[answers.markup] = true;
this.filters[answers.stylesheet] = true;
Expand Down