如何包含
Jison
将javascript库转换为有角项目?
此刻我得到:
警告输入 ./node_modules/jison/node_modules/source-map/lib/source-map/source-node.js 8:45-52严重依赖性:require函数以某种方式使用 不能静态提取哪些依赖项
和
获取http://localhost:4200/vendor.bundle.js net :: ERR_CONTENT_LENGTH_MISMATCH 200(OK)inline.bundle.js:55未捕获 TypeError:无法读取位于以下位置的未定义属性“ call” webpack_require (inline.bundle.js:55)
答案 0 :(得分:0)
安装到您的项目package.json
npm install jison -s
在您的tsconfig.app.json文件中,在您的类型数组中的“ compilerOptions”中包含“节点”
"compilerOptions": {
"types": [
"node"
]
}
然后将其导入任何TypeScript文件中。
import * as jison from 'jison';