SvelteKit Quick Start
Quick start guide for Codecov Bundle Analysis and SvelteKit.
Step 1: Install the Codecov SvelteKit Plugin
To install the @codecov/sveltekit-plugin to your project, use the following commands.
npm install @codecov/sveltekit-plugin --save-devyarn add @codecov/sveltekit-plugin --devpnpm add @codecov/sveltekit-plugin --save-devStep 2: Configure the bundler plugin
Add the plugin to the end of your modules array found inside your vite.config.ts file, and pass your configuration.
You can find a Codecov upload token on the Configuration page for your repository, under General, or your organization settings page in the Codecov UI. For more information, see the documentation.
import { sveltekit } from "@sveltejs/kit/vite";
import { defineConfig } from "vite";
import { codecovSvelteKitPlugin } from "@codecov/sveltekit-plugin";
export default defineConfig({
plugins: [
sveltekit(),
// Put the Codecov SvelteKit plugin after all other plugins
codecovSvelteKitPlugin({
enableBundleAnalysis: true,
bundleName: "example-sveltekit-bundle",
uploadToken: process.env.CODECOV_TOKEN,
}),
],
});Step 3: Commit and push your latest changes
The plugin requires at least one commit to be made to properly upload bundle analysis information to Codecov.
git add -A && git commit -m "Add Codecov bundler plugin" && git pushStep 4: Build the Application
When building your application the plugin will automatically upload the stats information to Codecov.
npm run buildyarn run buildpnpm run buildUpdated about 1 month ago