
Security News
npm Adopts OIDC for Trusted Publishing in CI/CD Workflows
npm now supports Trusted Publishing with OIDC, enabling secure package publishing directly from CI/CD workflows without relying on long-lived tokens.
@codecov/bundle-analyzer
Advanced tools
The bundle analyzer is an importable library and CLI for Codecov bundle analysis. It is designed for users who operate without a standard bundler that is otherwise supported by Codecov's bundler plugins.
[!NOTE] The plugin does not support code coverage, see our docs to set up coverage today!
Using npm:
npm install @codecov/bundle-analyzer --save-dev
Using yarn:
yarn add @codecov/bundle-analyzer --dev
Using pnpm:
pnpm add @codecov/bundle-analyzer --save-dev
This example shows how the package can be imported as a library.
// analyze.js
const { createAndUploadReport } = require("@codecov/bundle-analyzer");
const buildDirs = ["/path/to/build"];
const coreOpts = {
dryRun: true,
uploadToken: "your-upload-token",
retryCount: 3,
apiUrl: "https://api.codecov.io",
bundleName: "@codecov/example-bundle-analyzer-cjs",
enableBundleAnalysis: true,
debug: true,
};
const bundleAnalyzerOpts = {
beforeReportUpload: async (original) => original,
ignorePatterns: ["*.map"],
normalizeAssetsPattern: "[name]-[hash].js",
};
createAndUploadReport(buildDirs, coreOpts, bundleAnalyzerOpts)
.then((reportAsJson) =>
console.log(`Report successfully generated and uploaded: ${reportAsJson}`),
)
.catch((error) =>
console.error("Failed to generate or upload report:", error),
);
This example shows how the package can be used as a CLI.
npx @codecov/bundle-analyzer ./dist --bundle-name=my-identifier --upload-token=abcd --dry-run
[OPTIONAL] - A config file can be passed for any extended options matching those described here.
npx @codecov/bundle-analyzer ./dist --bundle-name=my-identifier --upload-token=abcd --dry-run --config-file=./config.json
// config.json
{
"gitService": "github",
"oidc": {
"useGitHubOIDC": false
}
}
The CLI tool supports the following operating systems:
FAQs
Official Codecov Bundle Analyzer
The npm package @codecov/bundle-analyzer receives a total of 1,158 weekly downloads. As such, @codecov/bundle-analyzer popularity was classified as popular.
We found that @codecov/bundle-analyzer demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 5 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
npm now supports Trusted Publishing with OIDC, enabling secure package publishing directly from CI/CD workflows without relying on long-lived tokens.
Research
/Security News
A RubyGems malware campaign used 60 malicious packages posing as automation tools to steal credentials from social media and marketing tool users.
Security News
The CNA Scorecard ranks CVE issuers by data completeness, revealing major gaps in patch info and software identifiers across thousands of vulnerabilities.