[]加载模块报错
想要引入外部的库:
ReferenceError: exports is not defined
生成的js是
刚接触ts,不太清楚怎么加载模块,编译时module是不是只能选commonjs?
import Collections = require('typescript-collections');配置如下:
{报错
"compilerOptions": {
"module": "commonjs",
"target": "es5",
"sourceMap": true,
"moduleResolution": "node",
"lib": [
"dom",
"es5"
]
},
"exclude": [
// "node_modules"
]
}
ReferenceError: exports is not defined
生成的js是
Object.defineProperty(exports, "__esModule", { value: true });
var Collections = require("typescript-collections");
刚接触ts,不太清楚怎么加载模块,编译时module是不是只能选commonjs?
没有找到相关结果
已邀请:
要回复问题请先登录
2 个回复
qian
赞同来自: ethaninmel
ethaninmel
赞同来自: