[Unity][小技巧]vscode快速导入"csharp"命名空间中的类型 #821
throw-out
started this conversation in
Show and tell
Replies: 1 comment 1 reply
-
为啥要
|
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
截至目前, vscode(v1.67.1)不支持
import { xx } = xxx
解构声明写法, 当我们需要使用csharp
模块中命名空间下的类型时, 往往需要写很多额外声明语句, 例如:我们可以将csharp下的命名空间重新包装成新的模块
csharp.namespace
, import语句格式如下:生成工具(适用于commonjs和esm)
查看工具地址: GeneratorECMAScript
实现代码(仅适用于commonjs):
打包工具
使用webpack等打包工具时, 编译会报错
Can't resolve 'xxx' in ...
同样通过配置externals列表解决Beta Was this translation helpful? Give feedback.
All reactions