首页 > 解决方案 > Index.ts 使用 webpack 嵌套导出

问题描述

我有这个打字稿源层次结构:

shared/
  columns/
    column.ts
    index.ts
  filters/
    column-filter.ts
    index.ts
  index.ts
test.ts

这里是文件的要点(抱歉,要点不支持文件夹):https ://gist.github.com/Jaroost/c79dc2384d49fcda35f12ef7e67a84c6

这里一切正常,即使循环导入(列导入列过滤器和列过滤器导入列)

但是当我在 shared/columns/ 中添加另一个文件 date-column.ts 并像这样更新 index.ts 时: https ://gist.github.com/Jaroost/5a24064e2d98d6856df108c7506d6be2

编译正常,但在导航器中出现此错误:

Uncaught TypeError: Super expression must either be null or a function

我做错了什么?

标签: typescriptwebpackcyclic-reference

解决方案


推荐阅读