marko-js / vite

A Marko plugin for Vite
MIT License
54 stars 7 forks source link

CJS imports in Marko files(SSR) #94

Closed rturnq closed 8 months ago

rturnq commented 8 months ago

Description

This PR enables better interop between Marko files and CJS imports in SSR builds. Specifically, this change should allow using named imports from files using module.exports.

Motivation and Context

Screenshots (if appropriate):

Checklist:

changeset-bot[bot] commented 8 months ago

🦋 Changeset detected

Latest commit: 6e2d3e4219f6240d4473dac9277916034c416a47

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package | Name | Type | | ----------- | ----- | | @marko/vite | Patch |

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

codecov[bot] commented 8 months ago

Codecov Report

Attention: 14 lines in your changes are missing coverage. Please review.

Comparison is base (04504ce) 76.53% compared to head (6e2d3e4) 76.53%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #94 +/- ## ========================================== - Coverage 76.53% 76.53% -0.01% ========================================== Files 9 11 +2 Lines 537 588 +51 Branches 120 135 +15 ========================================== + Hits 411 450 +39 - Misses 81 89 +8 - Partials 45 49 +4 ``` | [Files](https://app.codecov.io/gh/marko-js/vite/pull/94?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=marko-js) | Coverage Δ | | |---|---|---| | [src/index.ts](https://app.codecov.io/gh/marko-js/vite/pull/94?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=marko-js#diff-c3JjL2luZGV4LnRz) | `74.41% <100.00%> (-0.02%)` | :arrow_down: | | [src/babel-plugin-cjs-interop.ts](https://app.codecov.io/gh/marko-js/vite/pull/94?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=marko-js#diff-c3JjL2JhYmVsLXBsdWdpbi1janMtaW50ZXJvcC50cw==) | `74.07% <74.07%> (ø)` | | | [src/resolve.ts](https://app.codecov.io/gh/marko-js/vite/pull/94?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=marko-js#diff-c3JjL3Jlc29sdmUudHM=) | `78.12% <78.12%> (ø)` | |

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.