Advertisement
Guest User

Untitled

a guest
Mar 24th, 2019
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.98 KB | None | 0 0
  1. const Generator = require('yeoman-generator');
  2. // => We import the helper functions
  3. const { List, Input } = require('@webpack-cli/webpack-scaffold');
  4.  
  5. module.exports = class WebpackGenerator extends Generator {
  6. constructor(args, opts) { /* ... */ }
  7.  
  8. prompting() {
  9. return this.prompt([
  10. // => Input, asks the user to write a response
  11. Input('name', 'How do you want to name your project? (my-vue-project)'),
  12. Input('inFolder', 'Which folder will your source code be in? (src)'),
  13. Input('entry', 'Which is the entry point of your app? (main)'),
  14. Input('outFolder', 'Which folder will your generated bundles be in? (dist)'),
  15. Input('publicFolder', 'Which folder will your public assets be in? (public)'),
  16. // => List, lets the user select it's preferred choice from a list (e.g. yarn, npm)
  17. List('manager', 'Which package manager do you prefer?', ['yarn', 'npm'])
  18. ]).then (answers => {
  19. // => answers will contain the user's responses
  20. });
  21. }
  22. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement