FlareStart
HomeNewsHow ToSources
FlareStart

Where developers start their day. All the tech news & tutorials that matter, in one place.

Quick Links

  • Home
  • News
  • Tutorials
  • Sources
  • Privacy Policy

Connect

© 2026 FlareStart. All rights reserved.

Back to articles
Rollup Has a Free Plugin API That Powers Every Modern Bundler
NewsWeb Development

Rollup Has a Free Plugin API That Powers Every Modern Bundler

via Dev.to WebdevAlex Spinov2h ago

Rollup is the bundler behind Vite, and its plugin API is the de facto standard. If you've written a Vite plugin, you've used Rollup's API. The Rollup Plugin Interface // rollup.config.js export default { input : " src/index.js " , output : [ { file : " dist/bundle.cjs.js " , format : " cjs " }, { file : " dist/bundle.esm.js " , format : " es " }, { file : " dist/bundle.umd.js " , format : " umd " , name : " MyLib " }, ], plugins : [ myPlugin ()], }; Writing a Plugin: Full Lifecycle function jsonPlugin () { return { name : " json " , // Resolve custom module IDs resolveId ( source ) { if ( source === " virtual:config " ) return source ; return null ; // Defer to other plugins }, // Load content for resolved IDs load ( id ) { if ( id === " virtual:config " ) { return `export default ${ JSON . stringify ({ version : " 1.0 " })} ` ; } return null ; }, // Transform file contents transform ( code , id ) { if ( ! id . endsWith ( " .json " )) return null ; const parsed = JSON . parse ( code );

Continue reading on Dev.to Webdev

Opens in a new tab

Read Full Article
0 views

Related Articles

Demonetization Simulation
News

Demonetization Simulation

Dev.to • 34m ago

OneLuaPro v5.5.0.1 released
News

OneLuaPro v5.5.0.1 released

Lobsters • 38m ago

Is 1234567 Divisible by 7?
News

Is 1234567 Divisible by 7?

Medium Programming • 46m ago

News

Fresh Graduate, Zero Experience, One App on the Play Store

Medium Programming • 1h ago

Google Chrome Full Power Unlock | ২১ Super Useful Hidden Features | “Why didn’t I know these…
News

Google Chrome Full Power Unlock | ২১ Super Useful Hidden Features | “Why didn’t I know these…

Medium Programming • 1h ago

Discover More Articles