@vue/compat build flags explained

@vue/compat, the Vue 3 migration build, is a build of Vue 3 that can emulate Vue 2 behavior feature by feature. Each feature has a flag. Knowing which flags your code needs tells you exactly what is left to migrate.

Updated 2026-10-12

Runtime flags and compiler flags

Runtime flags (such as GLOBAL_MOUNT or INSTANCE_EVENT_EMITTER) are set with configureCompat(), globally or per component with the compatConfig option. Compiler flags (the COMPILER_ ones, such as COMPILER_FILTERS) change how templates compile and are set in the build tool.

Opt out (MODE 2)
main.js
// Default: Vue 2 behavior everywhere (MODE: 2)
import { configureCompat } from 'vue'

// opt out feature by feature
configureCompat({
  FILTERS: false,
  INSTANCE_EVENT_EMITTER: false,
})
Opt in (MODE 3)
main.js
// Recommended with vueleap: Vue 3 by default
import { configureCompat } from 'vue'

// opt in only to what the code still needs
configureCompat({
  MODE: 3,
  FILTERS: true,
  INSTANCE_EVENT_EMITTER: true,
})

Get the minimal flags for your project

vueleap maps every finding to its flag and prints the smallest configuration that keeps your app running, split into runtime and compiler parts:

Terminalbash
npx vueleap --compat

As you fix findings, rerun the command: flags disappear from the output, and you can delete them from your config. When nothing is left, remove @vue/compat.

Flags vueleap detects

FlagKindvueleap rules
COMPILER_FILTERSCompilerfilters: Filters are removed
COMPILER_INLINE_TEMPLATECompilerinline-template: inline-template is removed
COMPILER_IS_ON_ELEMENTCompileris-on-element: is on native elements needs the vue: prefix
COMPILER_V_BIND_OBJECT_ORDERCompilerv-bind-object-order: v-bind="object" is order sensitive
COMPILER_V_BIND_SYNCCompilersync-modifier: .sync is replaced by v-model:prop
COMPILER_V_IF_V_FOR_PRECEDENCECompilerv-if-v-for: v-if now has higher priority than v-for
COMPILER_V_ON_NATIVECompilernative-modifier: The .native modifier is removed
COMPONENT_FUNCTIONALRuntimefunctional-components: Functional components changed
COMPONENT_V_MODELRuntimecomponent-v-model: v-model on components uses modelValue
CONFIG_DEVTOOLSRuntimeglobal-config: Vue.config moved to app.config
CONFIG_IGNORED_ELEMENTSRuntimeconfig-ignored-elements: Vue.config.ignoredElements is replaced by isCustomElement
CONFIG_KEY_CODESRuntimeconfig-key-codes: Vue.config.keyCodes is removed
CONFIG_OPTION_MERGE_STRATSRuntimeglobal-config: Vue.config moved to app.config
CONFIG_PRODUCTION_TIPRuntimeconfig-production-tip: Vue.config.productionTip is removed
CONFIG_SILENTRuntimeglobal-config: Vue.config moved to app.config
CUSTOM_DIRRuntimedirective-hooks: Custom directive hooks are renamed
FILTERSRuntimefilters: Filters are removed
GLOBAL_DELETERuntimeset-delete: $set, $delete, Vue.set and Vue.delete are removed
GLOBAL_EXTENDRuntimeglobal-extend: Vue.extend is removed
GLOBAL_MOUNTRuntimeglobal-mount: new Vue() is replaced by createApp()
GLOBAL_OBSERVABLERuntimeglobal-api: Global Vue API moved to the app instance
GLOBAL_PRIVATE_UTILRuntimeglobal-api: Global Vue API moved to the app instance
GLOBAL_PROTOTYPERuntimeglobal-prototype: Vue.prototype is replaced by app.config.globalProperties
GLOBAL_SETRuntimeset-delete: $set, $delete, Vue.set and Vue.delete are removed
INSTANCE_ATTRS_CLASS_STYLERuntimeattrs-class-style: $attrs now includes class and style
INSTANCE_CHILDRENRuntimechildren: $children is removed
INSTANCE_DELETERuntimeset-delete: $set, $delete, Vue.set and Vue.delete are removed
INSTANCE_DESTROYRuntimedestroy: $destroy is removed
INSTANCE_EVENT_EMITTERRuntimeevent-emitter: $on, $off and $once are removed
INSTANCE_EVENT_HOOKSRuntimehook-events: hook: lifecycle events are renamed
INSTANCE_LISTENERSRuntimelisteners: $listeners is removed
INSTANCE_SCOPED_SLOTSRuntimescoped-slots: $scopedSlots is removed
INSTANCE_SETRuntimeset-delete: $set, $delete, Vue.set and Vue.delete are removed
OPTIONS_BEFORE_DESTROYRuntimedestroy-hooks: beforeDestroy and destroyed are renamed
OPTIONS_DATA_FNRuntimedata-object: data must be a function
OPTIONS_DESTROYEDRuntimedestroy-hooks: beforeDestroy and destroyed are renamed
RENDER_FUNCTIONRuntimerender-function-h: Render functions no longer receive h
TRANSITION_CLASSESRuntimetransition-classes: Transition classes renamed
TRANSITION_GROUP_ROOTRuntimetransition-group-root: <transition-group> renders no wrapper
V_ON_KEYCODE_MODIFIERRuntimekeycode-modifiers: KeyCode modifiers are removed
WATCH_ARRAYRuntimewatch-array: Array watchers need deep for mutations

The full list of flags, including ones that cannot be detected statically (such as ATTR_FALSE_VALUE), is in the official compat configuration reference.

Frequently asked questions

Use it for medium and large apps that cannot be migrated in one go: it lets the app run on Vue 3 while Vue 2 code is still being converted. It is a migration aid, so plan to remove it. Small apps are often faster to migrate directly.

configureCompat() sets runtime flags in the browser. Template flags (the COMPILER_ ones) are applied when templates are compiled, so they go in compilerOptions.compatConfig of your build tool plugin.

With MODE: 3, every feature behaves like Vue 3 unless its flag is set to true. With the default MODE: 2, everything behaves like Vue 2 unless its flag is set to false.