0
0
Vueframework~20 mins

Vue CLI and Vite setup - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Vue Setup Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
2:00remaining
Vite's default production build output folder
Which folder does Vite use by default for its production build output?
Adist
Boutput
Cpublic
Dbuild
Attempts:
2 left
💡 Hint
Think about the folder name you see after running the build command in Vite.
component_behavior
intermediate
2:00remaining
Behavior of hot module replacement (HMR) in Vue CLI vs Vite
Which statement correctly describes how hot module replacement (HMR) behaves differently between Vue CLI and Vite during development?
AVue CLI uses native ES modules for HMR, Vite bundles code before serving.
BVite disables HMR by default, Vue CLI enables it automatically.
CVite provides faster HMR by using native ES modules, while Vue CLI bundles code before serving.
DBoth Vue CLI and Vite use the same bundler and have identical HMR speeds.
Attempts:
2 left
💡 Hint
Consider how Vite serves files during development compared to Vue CLI.
📝 Syntax
advanced
2:00remaining
Correct command to create a new Vue 3 project using Vite
Which command correctly creates a new Vue 3 project using Vite with npm?
Anpm install vite create my-vue-app --template vue
Bnpm init vue@latest my-vue-app
Cvue create my-vue-app --template vite
Dnpm create vite@latest my-vue-app -- --template vue
Attempts:
2 left
💡 Hint
Vite uses a special npm create command with a template option.
🔧 Debug
advanced
2:00remaining
Error when running 'vue serve' in a Vite project
You run 'vue serve' inside a project created with Vite and get an error saying the command is not found. Why does this happen?
A'vue serve' is a Vue CLI command and is not available in Vite projects.
BYou need to install the 'vue-serve' package separately for Vite projects.
CThe command should be 'vite serve' instead of 'vue serve'.
D'vue serve' only works if you have Vue 2 installed.
Attempts:
2 left
💡 Hint
Think about which tool provides the 'vue serve' command.
lifecycle
expert
2:00remaining
How Vue CLI and Vite handle environment variables during build
Which statement correctly describes how Vue CLI and Vite handle environment variables during the build process?
AVite requires variables to be prefixed with VUE_APP_, Vue CLI requires VITE_ prefix
BVue CLI loads variables from .env files prefixed with VUE_APP_, Vite loads variables prefixed with VITE_
CBoth Vue CLI and Vite load all variables from .env files without any prefix requirement
DNeither Vue CLI nor Vite support environment variables from .env files
Attempts:
2 left
💡 Hint
Look at the prefixes required by each tool for environment variables to be exposed.