0
0
Vueframework~10 mins

Build optimization for production in Vue - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to enable production mode in Vue.

Vue
const app = createApp(App)
app.config.[1] = false
app.mount('#app')
Drag options to blanks, or click blank then click option'
AproductionTip
Bdevtools
CisProduction
Dperformance
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'devtools' instead of 'productionTip'
Trying to set 'isProduction' which is not a Vue config property
2fill in blank
medium

Complete the code to import the Vue production build for optimization.

Vue
import { createApp } from 'vue/dist/vue.[1].js'
const app = createApp(App)
app.mount('#app')
Drag options to blanks, or click blank then click option'
Aproduction
Bdevelopment
Cruntime
Dcompiler
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'development' build which is not optimized
Using 'runtime' which is incomplete for production
3fill in blank
hard

Fix the error in the Vue CLI build command for production.

Vue
vue-cli-service build --[1]
Drag options to blanks, or click blank then click option'
Adev
Bmode development
Cprod
Dmode production
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'dev' or 'prod' which are invalid flags
Omitting 'mode' keyword
4fill in blank
hard

Fill both blanks to configure Vue to remove devtools and enable performance tracking in production.

Vue
app.config.[1] = false
app.config.[2] = true
Drag options to blanks, or click blank then click option'
Adevtools
Bperformance
CproductionTip
Dsilent
Attempts:
3 left
💡 Hint
Common Mistakes
Confusing 'productionTip' with 'devtools'
Setting 'silent' which controls warnings, not devtools
5fill in blank
hard

Fill all three blanks to create a Vue 3 production build script with environment variable and minification.

Vue
export default {
  mode: '[1]',
  build: {
    [2]: true,
    [3]: true
  }
}
Drag options to blanks, or click blank then click option'
Adevelopment
Bproduction
Cminify
Dsourcemap
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'development' mode for production build
Confusing 'minify' with 'sourcemap' settings