Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>xtaro-vslinkNew to Visual Studio Code? Get it now.
xtaro-vslink

xtaro-vslink

hkqiu

|
21 installs
| (0) | Free
A vscode plugin that can associate xtaro files on different platforms
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

xtaro-vslink

简介

是一款专为携程 xTaro 框架开发的 VS Code 插件,允许开发者根据不同的平台环境自动关联对应平台的文件后缀(如 .crn.ts、.h5.ts、.mini.ts、.pc.ts )

通过状态栏中的平台切换功能,开发者可以轻松切换当前开发环境,插件会自动处理文件引用关系,提高开发效率

功能特性

它基于 tsconfig.json 配置文件实现跨平台文件的跳转和引用关联,借助 moduleSuffixes 实现文件关联优先级,根据用户在状态栏中的选择自动更新tsconfig.json 文件内容,各项目保持独立

配置项

VS Code 设置搜索 xtaro-vslink,可以通过 Included 手动管理插件接管的项目,blankSpace控制格式化的空格数

常见问题

1. 插件控制栏不显示或无法正确关联文件

检查是否为 xTaro 项目(通过 pkg 里是否含有 @ctrip/xtaro-cli 判断),同时不在 node_modules 目录内

2. tsconfig 被修改,是否会影响各端 build 结果?

不影响,xTaro 在打包成各端文件时不依赖 tsconfig.json 里配置的 moduleSuffixes,而生成单端产物不会有其他的平台文件,所以只会走到兜底的 ""

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft