更新时间:2023-11-05 15:46:22
现在,我使用ES6语法在所有导入内容的地方导入模块。从npm软件包导入时,我还使用 node_modules
目录中相关npm软件包中文件的相对路径。
Now I use ES6 syntax for importing modules everywhere I import something. I also use relative paths to files inside the relevant npm packages in node_modules
directory when I import from npm packages.
在 tsconfig.json 中,我还有其他几行:
In tsconfig.json I have these lines besides others:
"target": "ES3",
"lib": ["ES2020", "DOM"],
"module": "CommonJS"
最终的工作测试项目是此处。
The final working test project is here.
对于某些未预先配对以进行ES6导入的模块,我仍然有问题。
I still have problems with some modules that are not prepaired for ES6 import.