Question presented to candidate: "You are starting a brand-new Vue 3 project today. How do you create it, and can you walk me through the files and folders it generates and what each one is for?"
What a strong answer should cover:
- The official scaffolder is create-vue, run with
npm create vue@latest; it creates a Vite-based project. Vue CLI (webpack) is in maintenance mode and not used for new projects. - Optional features chosen at creation: TypeScript, JSX, Vue Router, Pinia, Vitest, Cypress or Playwright, ESLint and Prettier.
- The flow from
index.html(the real entry, with<div id="app">and a module script) tosrc/main.ts(createApp(App).mount('#app')) tosrc/App.vueand the component tree. - The roles of
src/components,src/assets,public/,vite.config.ts(the Vue plugin and the@alias),package.jsonscripts, the tsconfig files andenv.d.ts. - The commands:
npm install,npm run dev(dev server with hot module replacement),npm run build(type-check plus production build intodist/) andnpm run preview. - Where router and store files land when those features are selected (
src/router/index.ts,src/stores/,src/views/).
Clarifying questions expected:
- "Do we need routing, a store or tests from day one, or start minimal?"
- "TypeScript or plain JavaScript, and is server-side rendering (Nuxt) a requirement?"
Code / implementation expected: Yes. The scaffolding command, the generated main.ts, and a first App.vue.