# What is a compiler

uni-app can realize a set of codes and multi-terminal operation. The core is realized through compiler + runtime:

  • Compiler: Compile the uni-app unified code to generate the unique code supported by each platform; for example, on the applet platform, the compiler will split the .vue file to generate wxml, wxss, js etc. code.
  • Runtime: Dynamically process data binding and event proxy to ensure the consistency of Vue and platform host data;

The uni-app project has different compiler implementations depending on the version of Vue it depends on:

  • vue2: uni-app compiler is implemented based on wepback
  • vue3: The uni-app compiler is implemented based on Vite, and the compilation speed is faster. For details, please refer to: [vue3 and vite bidirectional blessing, uni-app performance is improved again](https://ask.dcloud.net.cn/article /39628)

uni-app项目根据创建方式的不同,编译器在使用上也有差异:

  • cli 方式创建的项目,编译器安装在项目下。编译器不会跟随HBuilderX升级。如需升级编译器,可以参考:更新依赖到指定版本
  • For projects created by the HBuilderX visual interface, the compiler is located in the plugin directory under the HBuilderX installation directory, and the compiler will be automatically upgraded with the upgrade of HBuilderX.
  • If you want to continue to use the project created by cli in HBuilderX, you can drag the project to HBuilderX. Note that if the entire project is dragged into HBuilderX, the compiler under the project is used when compiling. If the src directory is dragged into HBuilderX, the compiler in the plugin directory under the HBuilderX installation directory is used.