
Security News
CVE Volume Surges Past 48,000 in 2025 as WordPress Plugin Ecosystem Drives Growth
CVE disclosures hit a record 48,185 in 2025, driven largely by vulnerabilities in third-party WordPress plugins.
rollup-presets
Advanced tools
rollup-presets is a collection of opinionated, production-ready Rollup presets for building TypeScript libraries and applications.
// rollup.config.js
import { libraryPreset } from 'rollup-presets';
export default libraryPreset();
libraryPreset()Creates a production-ready Rollup configuration for TypeScript libraries. Bundle paths are automatically resolved from your package.json exports field or standard fields.
First, configure your package.json to define the bundle paths. You can use either conditional exports (recommended) or standard fields:
{
"name": "my-library",
"version": "1.0.0",
"exports": {
".": {
"import": "./dist/esm/index.js",
"require": "./dist/cjs/index.js",
"types": "./dist/types/index.d.ts",
"source": "./src/index.ts"
}
}
}
Or using standard fields:
{
"name": "my-library",
"version": "1.0.0",
"main": "./dist/cjs/index.js",
"module": "./dist/esm/index.js",
"types": "./dist/types/index.d.ts",
"source": "./src/index.ts"
}
Then create your rollup.config.js:
import { libraryPreset } from 'rollup-presets';
export default libraryPreset();
That's it! This will automatically:
libraryPreset({
// Build environment
environment: 'production',
// Keep directory structure
preserveModules: true,
// Output formats to generate
formats: ['esm', 'cjs'],
// Plugin stages for maximum control
plugins: {
// Stage 1: Pre-processing
// Perfect for file replacements, virtual modules, or environment setup
pre: [replacePlugin()],
// Stage 2: Path-aware Transformations
// Runs after TypeScript paths are resolved
// Perfect for CSS imports, asset handling, or any path-dependent plugins
transform: [cssPlugin()],
// Stage 3: Post-processing
// Perfect for bundle analysis, compression, or final optimizations
post: [analyzePlugin()]
},
// Customize esbuild options
esbuildOptions: {
target: 'es2020'
},
// Modify final config for each bundle
onCreateConfig: (config, bundlePath) => config
});
FAQs
A collection of opinionated, production-ready Rollup presets
The npm package rollup-presets receives a total of 6 weekly downloads. As such, rollup-presets popularity was classified as not popular.
We found that rollup-presets demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer 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
CVE disclosures hit a record 48,185 in 2025, driven largely by vulnerabilities in third-party WordPress plugins.

Security News
Socket CEO Feross Aboukhadijeh joins Insecure Agents to discuss CVE remediation and why supply chain attacks require a different security approach.

Security News
Tailwind Labs laid off 75% of its engineering team after revenue dropped 80%, as LLMs redirect traffic away from documentation where developers discover paid products.