【发布时间】:2017-07-03 08:04:39
【问题描述】:
我想在 browserify/tsify 包中使用 assert 模块。请参阅 https://www.npmjs.com/package/assert 和 https://github.com/substack/browserify-handbook#builtins 和 https://nodejs.org/api/assert.html。简而言之,它是浏览器中node-js 兼容的assert 模块,即browserify builtin。
所以我将@types/assert 添加到我的package.json。但是声明模块无法识别(似乎有问题)。所以我想做一个等效的node_modules/@types/assert 但在node_modules 之外,因为node_modules 不应该在源代码管理中。
有可能吗?如果没有,我可以/应该使用/// <reference 老式语法或declare module "assert" 还是什么?
【问题讨论】:
-
你用的是systemjs还是CLI哪个
-
我不使用 systemjs。我不确定 CLI,但似乎我将 browserify 的内置加载器用于 CommonJS 模块。
标签: typescript typescript-typings typescript2.0