SHARE
TWEET

Untitled

a guest Mar 24th, 2019 49 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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. };
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top