Skip to content

Conversation

@katywings
Copy link
Collaborator

I should go vacuum-cleaning now, but here is the short description:

Is

Currently microbundle adds externals to globals - excluding externals with dash (-). This results in rollup detecting the missing explicit global and defining the global implicitly with the name camel cased. Also will rollup log a warning like: No name was provided for external module 'microbundle-test' in output.globals – guessing 'microbundleTest.

Should

Since microbundle is adding the externals to globals by default, it should also include those with a dash as mentioned here - and therefore avoid the No name was provided rollup warning. Since rollup handles its dash fallback by adding the external camel cased to globals, microbundle should also do the same.

The only real difference of this change should be, that we don't get the rollup warning No name was provided for external module for externals with dash.

Considerations / Topics for further discussion

  • I am not 100% sure how rollups camel casing implementation looks like - literally couldn't find it in rollups src. This means that rollups camelcasing and microbundles is potentially not the same - in this case this could be a breaking change.
  • Since this fix is camel casing all externals for the globals, and not only those with a dash, there also is the chance that weird consumer externals like "Blub" will have a different automatic global name after this fix. I don't know any actual dependency that this would hit, but still want to mention it ;).

@developit developit merged commit 72619a0 into master Jun 20, 2020
@developit developit deleted the 643-dashed-globals branch June 20, 2020 21:07
@developit
Copy link
Owner

This works great!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants