Red*_*ant 5 typescript reactjs vite
阅读https://github.com/alan2207/bulletproof-react/blob/master/docs/project-struct.md后。我已经开始重新组织使用代码分割的反应站点的文件夹结构。组件文件夹如下所示:
src
client
product
product-list
index.ts
product-list.tsx
product-list-item.tsx
Run Code Online (Sandbox Code Playgroud)
index.ts 是一个重新导出 ProductList 组件的桶文件
// product-list/index.ts
export { ProductList } from './product-list';
export type { ProductListProps } from './product-list';
Run Code Online (Sandbox Code Playgroud)
但在构建过程中我从 Vite 收到了很多这样的警告:
Export "ProductList" of module "src/client/product/product-list/product-list.tsx" was
reexported through module "src/client/product/product-list/index.ts" while both
modules are dependencies of each other and will end up in different chunks by current
Rollup settings. This scenario is not well supported at the moment as it will produce
a circular dependency between chunks and will likely lead to broken execution order.
Either change the import in "src/client/product/product-list/product-list.tsx" to
point directly to the exporting module or reconfigure "output.manualChunks" to ensure
these modules end up in the same chunk.
Run Code Online (Sandbox Code Playgroud)
我需要担心这个吗?我是否应该按照 Vite.js 建议删除 index.ts 文件并直接指向product/product-list/product-list.tsx?
| 归档时间: |
|
| 查看次数: |
1166 次 |
| 最近记录: |