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

chore: set type to module in package.json #50

Merged
merged 1 commit into from Jan 25, 2022
Merged

Conversation

vursen
Copy link
Contributor

@vursen vursen commented Jan 25, 2022

The type property of package.json may be used by frontend tooling (e.g Webpack, Vite) in determining whether the package's entry point is a conventional CJS or ES module. If no property is specified, the entry point may be treated as a CJS module. As an illustration, here is a warning that Vite shows when you import vaadin-usage-statistics:

@vaadin/vaadin-usage-statistics doesn't appear to be written in CJS, but also doesn't appear to be a valid ES module (i.e. it doesn't have "type": "module" or an .mjs extension for the entry point). Please contact the package author to fix.

As long as Rollup converts vaadin-usage-statistics to an IIFE format, I assume the output bundle can be treated as a regular ES module so that it shouldn't be a problem if we set the type property to module that is needed to avoid possible misinterpretation.

Related to vaadin/flow#12574

Type of change

  • Internal

@CLAassistant
Copy link

CLAassistant commented Jan 25, 2022

CLA assistant check
All committers have signed the CLA.

@Artur- Artur- merged commit 20a5aee into master Jan 25, 2022
@Artur- Artur- deleted the chore/set-type-to-module branch January 25, 2022 12: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.

None yet

4 participants