Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const Generator = require('yeoman-generator');
- // => We import the helper functions
- const { List, Input } = require('@webpack-cli/webpack-scaffold');
- module.exports = class WebpackGenerator extends Generator {
- constructor(args, opts) { /* ... */ }
- prompting() {
- return this.prompt([
- // => Input, asks the user to write a response
- Input('name', 'How do you want to name your project? (my-vue-project)'),
- Input('inFolder', 'Which folder will your source code be in? (src)'),
- Input('entry', 'Which is the entry point of your app? (main)'),
- Input('outFolder', 'Which folder will your generated bundles be in? (dist)'),
- Input('publicFolder', 'Which folder will your public assets be in? (public)'),
- // => List, lets the user select it's preferred choice from a list (e.g. yarn, npm)
- List('manager', 'Which package manager do you prefer?', ['yarn', 'npm'])
- ]).then (answers => {
- // => answers will contain the user's responses
- });
- }
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement