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

feat: vite compatibility #5

Merged
merged 1 commit into from
Aug 26, 2021
Merged

Conversation

souljorje
Copy link
Contributor

@souljorje souljorje commented Aug 26, 2021

Build with vite unobviously adds ?commonjs-require suffix to files.
Found this problem while trying to exclude import of moment.js by chart.js. Without this feature importee stays in bundle.

build with vite unobviously adds ?commonjs-require suffix to files
@alex-kinokon
Copy link
Owner

??? That is a weird suffix.

@alex-kinokon alex-kinokon merged commit c722e7b into alex-kinokon:master Aug 26, 2021
@alex-kinokon
Copy link
Owner

Published as 1.0.10.

@souljorje
Copy link
Contributor Author

souljorje commented Aug 26, 2021

@proteriax found only this footprint: rolldown/vite@8feec8c
UPD: here we go https://github.com/rollup/plugins/blob/c954336dad283b17ba4fd958e3f7bb57b46e08dc/packages/commonjs/src/helpers.js

So for proper functionality we can:

  1. import these suffixes — stable but with dependency
  2. just add all of them to regex
  3. replace whole query

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

2 participants