Movatterモバイル変換


[0]ホーム

URL:


Step 1: Install the Codecov Rollup Plugin

Install the@codecov/rollup-plugin to your project.

npm install @codecov/rollup-plugin --save-dev
yarn add @codecov/rollup-plugin --dev
pnpm add @codecov/rollup-plugin --save-dev

Step 2: Configure the bundler plugin

Import the bundler plugin, and add it to the end of your plugins array found inside yourrollup.config.js file.

YYou 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, seethe documentation.

import { defineConfig } from "rollup";import { codecovRollupPlugin } from "@codecov/rollup-plugin";export default defineConfig({  plugins: [    // Put the Codecov Rollup plugin after all other plugins    codecovRollupPlugin({      enableBundleAnalysis: process.env.CODECOV_TOKEN !== undefined,      bundleName: "<bundle project name>",      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 push

Step 4: Build the application

When building your application the plugin will automatically upload the stats information to Codecov.

npm run build
yarn run build
pnpm run build

Sending Telemetry Data on Issues and Performance

By default, Codecov's bundler plugins collects telemetry data on issues and performance metrics internally, enabling us to analyze the plugins for performance and monitor potential issues.

You can opt-out of sending this telemetry data by setting theoptions.telemetry option in the plugin config tofalse. For example if you're using the Rollup plugin, the Codecov plugin configuration might look like the following:

codecovRollupPlugin({  enableBundleAnalysis: process.env.CODECOV_TOKEN !== undefined,  bundleName: "<bundle project name>",  uploadToken: process.env.CODECOV_TOKEN,  telemetry: false // <- Setting to `false`  // ... other options})

Updated 9 months ago



[8]ページ先頭

©2009-2025 Movatter.jp