import { PromptModuleAPI } from "../promptModuleAPI"; export default function(cli: PromptModuleAPI): void { cli.injectFeature({ name: "CSS Pre-processors", value: "css-preprocessor", description: "Add support for CSS pre-processors like Less or Styled-components", }); const notice = "PostCSS, Autoprefixer and CSS Modules(for less) are supported by default"; cli.injectPrompt({ name: "cssPreprocessor", when: (answers) => answers.features.includes("css-preprocessor"), type: "list", message: `Pick a CSS pre-processor${process.env.LUBAN_CLI_API_MODE ? "" : ` (${notice})`}:`, // description: `${notice}.`, choices: [ { name: "Less", value: "less", }, { name: "Styled-components", value: "styled-components", }, ], }); cli.onPromptComplete((answers, options) => { if (answers.features.includes("css-preprocessor")) { options.cssPreprocessor = answers.cssPreprocessor; } }); };