Skip to content

Commit

Permalink
enhancements: rename write to type and split params to newline
Browse files Browse the repository at this point in the history
  • Loading branch information
evenstensberg committed May 5, 2017
1 parent 663133a commit 907a1f7
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 8 deletions.
8 changes: 4 additions & 4 deletions lib/creator/yeoman/utils/entry.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ module.exports = (self, answer) => {
}
};

if(answer['entryType'] == 'Multiple') {
if(answer['entryType'] === 'Multiple') {
result = self.prompt([
InputValidate(
'multipleEntries',
'Write the name you want for your modules seperated by comma',
'Type the name you want for your modules seperated by comma',
validate
)
]).then( (multipleEntriesAnswer) => {
Expand All @@ -34,7 +34,7 @@ module.exports = (self, answer) => {
return self.prompt([
InputValidate(
'objectProperties',
'Write the location of those modules seperated by comma',
'Type the location of those modules seperated by comma',
validateProperties
)
]).then( (objectPropAnswer) => {
Expand All @@ -54,7 +54,7 @@ module.exports = (self, answer) => {
result = self.prompt([
InputValidate(
'singularEntry',
'Write the location of module you would like to use',
'Type the location of module you would like to use',
validate
)
]).then( (singularAnswer) => `'${singularAnswer['singularEntry']}.js'`);
Expand Down
18 changes: 14 additions & 4 deletions lib/creator/yeoman/webpack-generator.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,11 @@ module.exports = class WebpackGenerator extends Generator {
this.configuration.config.webpackOptions.module = getDefaultLoaders();
this.configuration.config.webpackOptions.plugins = getDefaultPlugins();
this.prompt([
RawList('entryType', 'Would you like to bundle a single or multiple javascript modules?',
['Single', 'Multiple'])
RawList(
'entryType',
'Would you like to bundle a single or multiple javascript modules?',
['Single', 'Multiple']
)
]).then( (entryTypeAnswer) => {
// Ask different questions for entry points
entryQuestions(self, entryTypeAnswer).then(entryOptions => {
Expand All @@ -38,7 +41,11 @@ module.exports = class WebpackGenerator extends Generator {
}).then( () => {

this.prompt([
InputValidate('outputType', 'What folder do you want to put those files in?', validate)
InputValidate(
'outputType',
'What folder do you want to put those files in?',
validate
)
]).then( (outputTypeAnswer) => {
if(!this.configuration.config.webpackOptions.entry.length) {
this.configuration.config.webpackOptions.output = {
Expand All @@ -54,7 +61,10 @@ module.exports = class WebpackGenerator extends Generator {
}).then( () => {
// Ask if the user wants to use extractPlugin
this.prompt([
Input('extractPlugin', 'What\'s the name of your css file? (press enter to skip)')
Input(
'extractPlugin',
'What\'s the name of your css file? (press enter to skip)'
)
]).then( (extractAnswer) => {
if(extractAnswer['extractPlugin'].length !== 0) {
this.configuration.config.webpackOptions.plugins.push(
Expand Down

0 comments on commit 907a1f7

Please sign in to comment.