English
uni-app
can realize a set of codes and multi-terminal operation. The core is realized through compiler + runtime
:
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.The uni-app
project has different compiler implementations depending on the version of Vue
it depends on:
uni-app
compiler is implemented based on wepbackuni-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
升级。如需升级编译器,可以参考:更新依赖到指定版本。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
.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.