antvis/G6

【V5】G6 lib Some lib export files are not fully compiled into cjs format. #6278

luckyKyle posted onGitHub

Describe the bug / 问题描述

在 webpack 项目里编译不通过,

1. G6的 lib 项的 export 文件没有完全编译成 cjs 格式, 2. 使用了“@babel/plugin-transform-class-properties”也无效。

No response

Steps to Reproduce the Bug or Issue / 重现步骤

<img width="1296" alt="322" src="https://github.com/user-attachments/assets/d0ebf9a7-9591-4343-b598-b471e2be66e0">

经过逐层摸排发现是引用有问题。 <img width="2038" alt="123" src="https://github.com/user-attachments/assets/49751480-d592-4d86-90ae-da936d02f77c">

另外如果直接讲 antv/g6使用 alias指向dist/g6.min.js 又会出现报语法错误 <img width="2294" alt="image" src="https://github.com/user-attachments/assets/3d1711ed-d6fe-49b9-9883-47d36753c6ab">

G6 Version / G6 版本

🆕 5.x

Operating System / 操作系统

macOS

Browser / 浏览器

Chrome

Additional context / 补充说明

希望能考虑兼容性,是否能将lib 目录的内容统一编译为 cjs 格式?期待回复!!


G6 采用的 TypeScript Compiler(tsc) 进行转译,lib 目录下为标准的 commonjs,你的问题可能是没有正确配置 Webpack loader导致的,请检查是否配置了 ts-loader

posted by Aarebecca 8 months ago

Fund this Issue

$0.00
Funded

Pull requests