-
Notifications
You must be signed in to change notification settings - Fork 1
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: Add BA support for SvelteKit #126
feat: Add BA support for SvelteKit #126
Conversation
Codecov ReportAttention: Patch coverage is
✅ All tests successful. No failed tests found. Additional details and impacted files
☔ View full report in Codecov by Sentry. |
Bundle ReportChanges will decrease total bundle size by 27.8kB ⬇️
|
Bundle ReportChanges will decrease total bundle size by 210.88kB ⬇️
|
bundleName = `${bundleName}-${dir}`; | ||
} | ||
|
||
format = format === "es" ? "esm" : format; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
l: let's avoid rebinding passed in parameters.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done, both here and in the Nuxt plugin 🫡
packages/webpack-plugin/LICENSE
Outdated
@@ -1,6 +1,6 @@ | |||
MIT License | |||
|
|||
Copyright (c) 2023 Codecov | |||
Copyright (c) 2024 Codecov |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you actually want to use a date range here (2023-2024
) if you update to latest year.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ouu ty ty for the catch
import { getBundleName } from "./getBundleName"; | ||
|
||
// @ts-expect-error this value is being replaced by rollup | ||
const PLUGIN_NAME = __PACKAGE_NAME__ as string; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's define
declare global {
__PACKAGE_NAME__: string;
__PACKAGE_VERSION__: string;
}
in a TS declaration file somewhere so we can remove these. Feel free to do it in a follow up PR.
export function getBundleName( | ||
initialName = "", | ||
initialDir = "", | ||
format: string, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: this can be typed as ModuleFormat
from rollup. Same as other places that use this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it be alright to re-export this type from the Vite bundler plugin package? And then import and use it in here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah that's fine!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hrrm it actually doesn't seem like Vite re-exports these types, soooo I'd have to install Rollup as a dev dep eh?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you grab the type from UnpluginOptions
? Otherwise don't worry too much, we can leave it as is.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Checked the options ... and no dice with that.
Codecov ReportAttention: Patch coverage is ✅ All tests successful. No failed tests found.
📢 Thoughts on this report? Let us know! |
Description
This PR adds in direct support for SvelteKit apps through the introduction of a new plugin that is tailored for SvelteKit.
Closes #94
Code Example
Notable Changes
@codecov/sveltekit-plugin