0
0
Vueframework~20 mins

Running and building a Vue app - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Vue Build Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
component_behavior
intermediate
1:30remaining
What happens when you run npm run serve in a Vue 3 app?

You have a Vue 3 project created with Vite. You run npm run serve. What is the expected behavior?

AStarts a local development server with hot module replacement for live updates.
BBuilds the app into static files for production deployment.
CRuns unit tests defined in the project.
DInstalls project dependencies before starting the app.
Attempts:
2 left
💡 Hint

Think about what a development server does compared to building for production.

📝 Syntax
intermediate
1:00remaining
Which command correctly builds a Vue 3 app for production using Vite?

You want to create optimized static files for deployment from your Vue 3 project using Vite. Which command do you run?

Anpm run start
Bnpm run serve
Cnpm run build
Dnpm run dev
Attempts:
2 left
💡 Hint

Building means preparing files for production, not running a server.

🔧 Debug
advanced
1:30remaining
Why does npm run serve fail with 'command not found' in a Vue 3 project?

You cloned a Vue 3 project and ran npm run serve, but get command not found. What is the most likely cause?

AYou need to run <code>vue serve</code> instead of <code>npm run serve</code>.
BThe <code>serve</code> script is missing in <code>package.json</code> scripts section.
CYou forgot to install dependencies with <code>npm install</code>.
DThe Node.js version is too old to run Vue commands.
Attempts:
2 left
💡 Hint

Check the package.json file for scripts.

state_output
advanced
1:00remaining
What is the output folder after running npm run build in a Vue 3 Vite project?

After running npm run build in a Vue 3 project using Vite, which folder contains the production-ready files?

Asrc
Bbuild
Cpublic
Ddist
Attempts:
2 left
💡 Hint

Look for the default output folder Vite uses.

🧠 Conceptual
expert
2:00remaining
Why is it important to use npm run build before deploying a Vue 3 app?

Explain why running npm run build is necessary before deploying a Vue 3 app to a web server.

AIt compiles and optimizes the app into static files that load faster and work without a dev server.
BIt installs all dependencies needed for the app to run on the server.
CIt starts a local server so you can test the app before deployment.
DIt converts Vue files into plain HTML files without JavaScript.
Attempts:
2 left
💡 Hint

Think about what production-ready files need to be like.