Skip to content

[Tracking] Rollup Plugin Compat Status #819

@underfin

Description

@underfin

Plugin Hooks

Fully Supported Hooks

  • options
  • buildStart
  • buildEnd
  • renderStart
  • renderError
  • generateBundle
  • writeBundle
  • closeBundle
  • banner
  • footer
  • intro
  • outro
  • augmentChunkHash
  • closeWatcher
  • watchChange
  • renderChunk

Partually Supported Hooks

Hooks in this section can work as intended for most commonly seen plugins, but they may have some niche options / behavior that are not implemented yet.

Our priority at this stage is implement enough compatibility for most plugins to run, and determine whether to support the niche options at a later stage based on user demand. Some options are explicitly marked as "will not support" due to architectural incompatibility and limited use case.

  • outputOptions
    • the PluginContext is not supported yet.
  • resolveId
    • the 3rd argument options.attributes is not supported yet
    • the following fileds in the return value are not supported yet:
      • attributes
      • resolvedBy
      • syntheticNamedExports
  • load
    • the following fileds in the return value are not supported yet:
      • attributes
      • syntheticNamedExports
      • ast will not support
  • transform
    • the following fileds in the return value are not supported yet:
      • attributes
      • syntheticNamedExports
      • ast will not support
  • moduleParsed
    • the argument moduleInfo is only partially compatible
  • resolveDynamicImport
    • the 3rd argument options.attributes is not supported yet
  • onLog
    • the meta property is not supported yet

Not Yet Supported

  • shouldTransformCachedModule
  • resolveFileUrl
  • resolveImportMeta
  • renderDynamicImport

Plugin Context

Supported Properties

  • debug
  • error
  • info
  • warn
  • getFileName
  • getModuleIds
  • getModuleInfo
  • addWatchFile
  • getCombinedSourcemap
  • parse

Partially Supported Properties

  • resolve
    • options.isEntry and options.attributes are not supported yet
  • emitFile
    • only support emitting asset and chunk for now
  • load
    • only support call at resolved(not resolving entry ids)/load/transform hooks

Not Yet Supported Properties

  • meta
  • cache
  • getWatchFiles
  • setAssetSource

Vite Internal Plugins Compatibility

  • assetPlugin.
  • assetImportMetaUrlPlugin
  • clientInjectionsPlugin
  • completeSystemWrapPlugin
  • cssPlugin
  • cssPostPlugin
  • cssAnalysisPlugin
  • dataURIPlugin
  • definePlugin
  • *dynamicImportVarsPlugin
  • esbuildPlugin
  • buildEsbuildPlugin
  • htmlInlineProxyPlugin
  • buildHtmlPlugin
  • importAnalysisPlugin
  • buildImportAnalysisPlugin
  • importGlobPlugin - needs resolveId#option the argument fileds attributes
  • jsonPlugin
  • loadFallbackPlugin
  • manifestPlugin
  • metadataPlugin , needs mutate( add extra fileds) renderChunkArgs#RenderedChunk and using it at augmentChunkHash/generateBundle, it rewrite to stored at js side.
  • modulePreloadPolyfillPlugin
  • optimizedDepsPlugin
  • preAliasPlugin
  • buildReporterPlugin
  • resolvePlugin
  • splitVendorChunkPlugin - needs manualChunks. @deprecated
  • terserPlugin
  • wasmFallbackPlugin
  • wasmHelperPlugin
  • webWorkerPostPlugin - needs resolveImportMeta
  • webWorkerPlugin - needs shouldTransformCachedModule
  • workerImportMetaUrlPlugin - needs shouldTransformCachedModule
  • ssrManifestPlugin

Vite Public Plugins Compatibility

  • @vitejs/plugin-vue
  • @vitejs/plugin-vue-jsx
  • @vitejs/plugin-react

Rollup Official Plugins Compatibility

Supported as Built-in

The following Rollup plugins are no longer needed because Rolldown offers built-in support for equivalent features:

  • @rollup/plugin-alias - use resolve.alias option instead.
  • @rollup/plugin-commonjs - Rolldown has built-in support
  • @rollup/plugin-inject - use inject option instead.
  • @rollup/plugin-node-resolve - Rolldown has built-in support
  • @rollup/plugin-json - Rolldown has built-in support
  • @rollup/plugin-replace - Rolldown provides built-in support via import { replacePlugin } from 'rolldown/experimental'
  • @rollup/plugin-swc, @rollup/plugin-babel, @rollup/plugin-sucrase - Rolldown has built-in TS / JSX transform support via Oxc. Target-lowering transforms are WIP.
  • @rollup/plugin-dynamic-import-vars , Rolldown provides built-in support via import { dynamicImportVarsPlugin } from 'rolldown/experimental'.

Fully Compatible Plugins

  • @rollup/plugin-auto-install
  • @rollup/plugin-beep
  • @rollup/plugin-data-uri
  • @rollup/plugin-dsv
  • @rollup/plugin-eslint - consider using oxlint instead
  • @rollup/plugin-esm-shim
  • @rollup/plugin-graphql
  • @rollup/plugin-legacy
  • @rollup/plugin-run
  • @rollup/plugin-terser - Rolldown has built-in minifcation via output.minify option, but it's still WIP
  • @rollup/plugin-virtual -
  • @rollup/plugin-yaml
  • @rollup/plugin-multi-entry
  • @rollup/plugin-image
  • @rollup/plugin-url
  • @rollup/plugin-wasm will likely have built-in support
  • @rollup/plugin-html
  • @rollup/plugin-buble
  • @rollup/plugin-strip

Not Yet Compatible

  • @rollup/plugin-typescript - Rolldown will support emitting bundled dts with isolatedDeclarations: true in the future

Vite Ecosystem

analog

  • jitPlugin - needs find plugin by plugin name at buildStart options, then using the plugin transform, see here

astro

  • astroScannerPlugin - needs using PluginContext#getModuleInfo as TransformResult#meta, see here, (todo find usage)
  • markdown - needs LoadResult#meta
  • html - needs mutate NormalizedOption#plugins at options hook, see here
  • astroHeadBuildPlugin - needs mutate ModuleInfo#meta using PluginContext#getModuleInfo at generateBundle hook, see here
  • postprocess direct using acorn#parse
  • vitePluginAnalyzer using ModuleInfo#meta by PluginContext#getModuleIds/getModuleInfo at generateBundle hook, see here
  • vitePluginContent mutate NormalizedOption#input at options hook, see here, mutate NormalizedOption#manualChunks at same file
  • css TODO
  • import.meta.ROLLUP_FILE_URL_*

histoire

mutate NormalizedOption#external(look like is not correct), see here

qwik

qwikCityPlugin used moduleSideEffect: no-treeshake, see here

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions