prompts.js 563 B

123456789101112131415161718192021222324
  1. const fs = require('fs');
  2. module.exports = [
  3. {
  4. type: 'list',
  5. name: 'initConfig',
  6. message: 'Generate tailwind.config.js',
  7. choices: [
  8. { name: 'none', value: false },
  9. { name: 'minimal', value: 'minimal' },
  10. { name: 'full', value: 'full' },
  11. ],
  12. default: 1,
  13. },
  14. {
  15. name: 'replaceConfig',
  16. type: 'confirm',
  17. message: 'tailwind.config.js already exists! Do you want to replace it?',
  18. default: false,
  19. when: answers => {
  20. return answers.initConfig && fs.existsSync('./tailwind.config.js');
  21. },
  22. },
  23. ];