tezvyn:

Why does create-vue ask about Pinia and Vitest during scaffolding?

AI-drafted, machine-checkedSource: vuejs.orgbeginner

Tests knowledge of Vue's lean core and modular tooling. Good answers note that create-vue conditionally installs deps, scaffolds folders like src/stores or tests/, and pre-configures Vite so you skip manual wiring.

WHAT THIS TESTS: This question probes whether you understand that Vue is intentionally designed as a lean runtime core with an opt-in ecosystem rather than a monolithic framework. Interviewers want to see that you know create-vue is a Vite-based scaffolding tool, not the framework itself, and that each prompt corresponds to a deliberate architectural choice about dependencies, directory structure, and build configuration. They are checking if you recognize that modern Vue projects are assembled from official but separate libraries.

A GOOD ANSWER COVERS: First, the philosophy: Vue keeps the core small and lets teams add only what they need, which keeps bundle sizes down and avoids forcing opinions. Second, the dependency impact: saying yes to Pinia adds the pinia package to package.json; saying yes to Vitest adds vitest and related testing utilities. Third, the structural impact: the generator creates directories like src/stores with starter files or a tests/ folder with sample specs, and it updates main.js or vite.config.js to wire those tools automatically. Fourth, the developer experience goal: these prompts eliminate hours of manual toolchain configuration by providing official, battle-tested integrations out of the box so developers can start writing features immediately.

COMMON WRONG ANSWERS: A red flag is claiming Vue is incomplete because it does not bundle state management or testing by default. Another mistake is confusing create-vue with the legacy Vue CLI, which was webpack-based and managed dependencies differently. Candidates also stumble by describing the prompts as runtime configuration choices rather than one-time scaffolding decisions that permanently shape the project skeleton and lockfile.

LIKELY FOLLOW-UPS: An interviewer might ask how you would add Pinia to an existing project if you initially skipped it. They may also ask about the difference between create-vue and the older Vue CLI, or how tree-shaking ensures that unused optional dependencies do not end up in the production bundle. You might also be asked why Vite is the chosen build tool over webpack, or how the official VS Code extension leverages the generated config.

ONE CONCRETE EXAMPLE: Imagine you scaffold a project and select Pinia but skip Vitest. The resulting package.json will list pinia as a dependency and main.js will import and install the Pinia plugin, while src/stores/counter.js appears as a starter store. No test directories or vitest config will exist. If you later need Vitest, you must install it manually and create the config yourself, whereas the CLI would have generated vitest.config.js and sample component tests automatically.

Read the original → vuejs.org

Get five bites like this every day.

Tezvyn delivers a daily feed of 60-second tech bites with quizzes to lock in what you learn.