Open underfin opened 7 months ago
import.meta.ROLLUP_FILE_URL_*
needs to be supported as well:
https://stackblitz.com/edit/github-6jajke-dkf5gh?file=rolldown.config.mjs
It seems astro uses it: https://github.com/withastro/astro/blob/1c64ae304d3c008a776e98e48fd3ece8be7b1fb5/packages/db/src/core/integration/file-url.ts#L32
Plugin Hooks
Fully Supported Hooks
options
buildStart
buildEnd
renderStart
renderError
generateBundle
writeBundle
closeBundle
banner
footer
intro
outro
augmentChunkHash
closeWatcher
watchChange
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
PluginContext
is not supported yet.resolveId
options.attributes
is not supported yetexternal
attributes
resolvedBy
syntheticNamedExports
load
attributes
syntheticNamedExports
ast
will not supporttransform
attributes
syntheticNamedExports
ast
will not supportrenderChunk
meta
argument is not supported yetmoduleParsed
moduleInfo
is only partially compatibleresolveDynamicImport
options.attributes
is not supported yetonLog
meta
property is not supported yetNot Yet Supported
shouldTransformCachedModule
resolveFileUrl
resolveImportMeta
renderDynamicImport
Plugin Context
Supported Properties
debug
error
info
warn
getFileName
getModuleIds
getModuleInfo
addWatchFile
Partially Supported Properties
resolve
options.isEntry
andoptions.attributes
are not supported yetemitFile
load
resolved(not resolving entry ids)/load/transform
hooksNot Yet Supported Properties
getCombinedSourcemap
meta
cache
getWatchFiles
setAssetSource
parse
will not supportVite Internal Plugins Compatibility
assetPlugin
.assetImportMetaUrlPlugin
clientInjectionsPlugin
completeSystemWrapPlugin
cssPlugin
cssPostPlugin
cssAnalysisPlugin
dataURIPlugin
definePlugin
dynamicImportVarsPlugin
esbuildPlugin
buildEsbuildPlugin
htmlInlineProxyPlugin
buildHtmlPlugin
importAnalysisPlugin
buildImportAnalysisPlugin
importGlobPlugin
- needsresolveId#option
the argument filedsattributes
jsonPlugin
loadFallbackPlugin
manifestPlugin
metadataPlugin
, needs mutate( add extra fileds)renderChunkArgs#RenderedChunk
and using it ataugmentChunkHash/generateBundle
, it rewrite to stored at js side.modulePreloadPolyfillPlugin
optimizedDepsPlugin
preAliasPlugin
buildReporterPlugin
resolvePlugin
splitVendorChunkPlugin
- needsmanualChunks
. @deprecatedterserPlugin
wasmFallbackPlugin
wasmHelperPlugin
webWorkerPostPlugin
- needsresolveImportMeta
webWorkerPlugin
- needsshouldTransformCachedModule
workerImportMetaUrlPlugin
- needsshouldTransformCachedModule
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
- useresolve.alias
option instead.@rollup/plugin-commonjs
- Rolldown has built-in support@rollup/plugin-inject
- useinject
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 viaimport { 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.Fully Compatible Plugins
@rollup/plugin-auto-install
@rollup/plugin-beep
@rollup/plugin-data-uri
@rollup/plugin-dsv
@rollup/plugin-eslint
- consider usingoxlint
instead@rollup/plugin-esm-shim
@rollup/plugin-graphql
@rollup/plugin-legacy
@rollup/plugin-run
@rollup/plugin-terser
- Rolldown has built-in minifcation viaoutput.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
Not Yet Compatible
@rollup/plugin-strip
- usesPluginContext#parse
@rollup/plugin-typescript
- Rolldown will support emitting bundled dts withisolatedDeclarations: true
in the future@rollup/plugin-dynamic-import-vars
usingPluginContext#parse
, will have built-in supportVite Ecosystem
analog
jitPlugin
- needs find plugin by plugin name atbuildStart
options, then using the plugintransform
, see hereastro
astroScannerPlugin
- needs usingPluginContext#getModuleInfo
asTransformResult#meta
, see here, (todo find usage)markdown
- needsLoadResult#meta
html
- needs mutateNormalizedOption#plugins
atoptions
hook, see hereastroHeadBuildPlugin
- needs mutateModuleInfo#meta
usingPluginContext#getModuleInfo
at generateBundle hook, see herepostprocess
direct usingacorn#parse
vitePluginAnalyzer
usingModuleInfo#meta
byPluginContext#getModuleIds/getModuleInfo
at generateBundle hook, see herevitePluginContent
mutateNormalizedOption#input
atoptions
hook, see here, mutateNormalizedOption#manualChunks
at same filecss
TODOimport.meta.ROLLUP_FILE_URL_*
histoire
mutate
NormalizedOption#external
(look like is not correct), see hereqwik
qwikCityPlugin
usedmoduleSideEffect: no-treeshake
, see here