Closed ycmjason closed 6 years ago
Hi!
Thank you so much for making this. This package is amazing and is the best out there from what I have seen.
I am making a library with this package using rollup. But rollup seems to struggle with the circular dependencies that this module has.
(!) Circular dependency: node_modules/ebnf/dist/index.js -> node_modules/ebnf/dist/Grammars/index.js -> node_modules/ebnf/dist/Grammars/BNF.js -> node_modules/ebnf/dist/index.js (!) Circular dependency: node_modules/ebnf/dist/index.js -> node_modules/ebnf/dist/Grammars/index.js -> node_modules/ebnf/dist/Grammars/BNF.js -> node_modules/ebnf/dist/index.js -> node_modules/ebnf/dist/index.js (!) Circular dependency: node_modules/ebnf/dist/index.js -> node_modules/ebnf/dist/Grammars/index.js -> node_modules/ebnf/dist/Grammars/W3CEBNF.js -> node_modules/ebnf/dist/index.js (!) Circular dependency: node_modules/ebnf/dist/index.js -> node_modules/ebnf/dist/Grammars/index.js -> node_modules/ebnf/dist/Grammars/Custom.js -> node_modules/ebnf/dist/index.js
Briefly inspecting, looks like to me the problem comes from the index.js files which act as the entry of the modules (Grammers and ebnf).
index.js
Grammers
ebnf
By removing index.js and importing corresponding files instead, this circular dependency issue should be solved.
This might also help rollup to shake the tree more accurately producing smaller module.
Happy to submit a PR if this is not something you really insist on. (index.js as entry of module)
Congratulate again on your great work! 💯
Merged
Hi!
Thank you so much for making this. This package is amazing and is the best out there from what I have seen.
I am making a library with this package using rollup. But rollup seems to struggle with the circular dependencies that this module has.
Briefly inspecting, looks like to me the problem comes from the
index.js
files which act as the entry of the modules (Grammers
andebnf
).By removing
index.js
and importing corresponding files instead, this circular dependency issue should be solved.This might also help rollup to shake the tree more accurately producing smaller module.
Happy to submit a PR if this is not something you really insist on. (
index.js
as entry of module)Congratulate again on your great work! 💯