Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow multiple package specs to output in source if they have different suffixes #158

Conversation

anmonteiro
Copy link
Member

This fixes #157.

  • I'm not too sure if we should necessarily merge this. Is it common for people to want multiple different modules compiled in source?
  • There's an edge case here where if you specify both .js and .bs.js suffixes, we'll gladly emit them in source. Couldn't that cause bundlers to include both (copies of the same) modules in the bundled output?

Comment on lines +80 to +81
let distinct_suffixes = Set_string.cardinal !distinct_suffixes in
if !has_in_source > distinct_suffixes then
Copy link
Collaborator

@EduardoRFS EduardoRFS Apr 9, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it is better if we check if there is the needed suffixes instead of looking the cardinality.

Also because we can say suffix X appears two times

@anmonteiro
Copy link
Member Author

The dune integration, and ocaml/dune#7193 in particular, allows this.

@anmonteiro anmonteiro closed this Mar 19, 2023
@anmonteiro anmonteiro deleted the anmonteiro/relax-in-source-assumption-for-multiple-suffixes branch March 19, 2023 07:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow two package-specs in source if they have different suffixes
2 participants