Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using Rolldown with Vite v6 #43

Draft
wants to merge 138 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
138 commits
Select commit Hold shift + click to select a range
3d1d885
feat: use rolldown in the dep optimizer
sapphi-red Sep 11, 2024
07f5b36
feat: use rolldown for build
sapphi-red Sep 12, 2024
d9a402d
chore: skip plugin-legacy build
sapphi-red Sep 12, 2024
ce60c11
chore: skip typecheck for now
sapphi-red Sep 12, 2024
e0b5f42
chore: 🤖 add justfile for faster dev
IWANABETHATGUY Aug 15, 2024
3dbd031
feat: add experimental.enableNativePlugin (#41)
IWANABETHATGUY Sep 10, 2024
776b9d4
feat: clone class plugins correctly
IWANABETHATGUY Sep 13, 2024
6eff099
feat: native build plugins (#45) (#46)
IWANABETHATGUY Sep 12, 2024
ccfa683
perf: reduce pre alias plugin in build mode
IWANABETHATGUY Sep 12, 2024
211f582
feat: 🎸 add an new option to disable build report
IWANABETHATGUY Sep 13, 2024
0968618
feat: support native define
sapphi-red Sep 18, 2024
bd971ce
feat: use filter for plugins (#49) (#50) (#51) (#52) (#53)
sapphi-red Sep 18, 2024
170dccb
perf: ⚡️ use default resolver (#56)
IWANABETHATGUY Sep 14, 2024
7e9042f
chore: bump rolldown
sapphi-red Sep 24, 2024
dc22776
chore: skip data uri by load fallback plugin for native data uri hand…
sapphi-red Sep 24, 2024
8463e80
feat: handle non-relative paths by Vite's resolver for enableNativePl…
sapphi-red Sep 19, 2024
c8f2d5c
chore: remove browser field edge case test
sapphi-red Sep 25, 2024
bea6e18
chore: use advancedChunks instead of manualChunks
sapphi-red Oct 1, 2024
e370b0b
feat: convert `optimizeDeps.esbuildOptions` to `optimizeDeps.rollupOp…
sapphi-red Oct 4, 2024
e01f080
fix: optimizeDeps test pass on windows
sapphi-red Oct 9, 2024
5dcbb01
chore: make some tests passing
sapphi-red Oct 9, 2024
2cad4de
chore: make glob-import test pass with workarounds
sapphi-red Oct 9, 2024
08958b8
chore: run worker-es tests
sapphi-red Oct 9, 2024
a109ad7
fix: use preliminaryFileName for chunkMetadata key
sapphi-red Oct 10, 2024
d114531
feat: oxc tranformer (#60)
underfin Oct 11, 2024
7163a48
feat: use `onlyRemoveTypeImports`
sapphi-red Oct 11, 2024
f197581
chore: enable continuous release under rolldown-vite (#61)
yyx990803 Oct 12, 2024
852231c
feat: environment aware native plugins
sapphi-red Oct 15, 2024
d88767c
feat: export transformWithOxc (#62)
underfin Oct 17, 2024
9bcfd08
feat: add oxc jsxInclude and jsxExclude (#63)
underfin Oct 18, 2024
42b959c
chore: update some tests that relies on rollup's behavior
sapphi-red Oct 24, 2024
6861f20
chore: skip environment-react-ssr for now
sapphi-red Oct 24, 2024
af1c5c8
chore: bump rolldown
sapphi-red Oct 24, 2024
73f4545
chore: skip minifySyntax test as it relies on specific esbuild option
sapphi-red Oct 24, 2024
efbbd26
chore: fix type errors
sapphi-red Oct 24, 2024
f4a296a
chore: skip sideeffects set for HTML scripts for now
sapphi-red Nov 6, 2024
75c26b6
chore: tweak tests
sapphi-red Nov 6, 2024
3d9bd0c
chore: bump rolldown
sapphi-red Nov 6, 2024
cd1a2f4
chore: enable backend-integration test
sapphi-red Nov 6, 2024
ae159e3
chore: skip error message test
sapphi-red Nov 13, 2024
897eb0a
feat: enable lib mode tests (#64)
sapphi-red Nov 13, 2024
801c7cd
chore: fix LICENSE
sapphi-red Nov 14, 2024
af5fa95
chore: uncomment things implemented on rolldown now
sapphi-red Nov 18, 2024
8a29195
chore: enable html sideeffects test
sapphi-red Nov 18, 2024
0896731
chore: reduce diff
sapphi-red Nov 18, 2024
7c9ae51
feat: use native Vite resolver (#65)
sapphi-red Nov 19, 2024
8fb3903
chore: add workaround and make environment-react-ssr playground pass
sapphi-red Nov 21, 2024
4eb2cb2
chore: add comment
sapphi-red Nov 21, 2024
64cad08
chore: fix oxc option convertion and reduce warnings
sapphi-red Nov 22, 2024
20f4245
chore: bump rolldown
sapphi-red Nov 25, 2024
a381888
chore: update snapshot
sapphi-red Nov 25, 2024
d44e117
chore: fix for new vite resolve plugin
sapphi-red Nov 25, 2024
8528111
feat: use native plugin for create id resolver (#68)
sapphi-red Nov 25, 2024
9b010b0
chore: bump rolldown
sapphi-red Nov 28, 2024
d3d4227
chore: fix for the latest rolldown
sapphi-red Nov 28, 2024
9a395f1
chore: enable modulepreload unit test
sapphi-red Nov 28, 2024
098dd5d
chore: bump rolldown
sapphi-red Nov 29, 2024
6d0dabc
chore: set platform option and remove workaround in environment-react…
sapphi-red Nov 29, 2024
b87e356
chore: update some tests that relies on rollup's behavior
sapphi-red Nov 29, 2024
59d73f1
feat: use rolldown for config loader (#69)
sapphi-red Nov 29, 2024
d97d8e9
feat: use rolldown effectively for the optimizer (#70)
sapphi-red Nov 29, 2024
2796d9e
feat: use oxc for non-native define plugin (#71)
sapphi-red Dec 3, 2024
afad43a
feat: use lightningcss by default for cssMinify (#72)
sapphi-red Dec 3, 2024
45650ad
chore: reduce oxc not supported warnings
sapphi-red Dec 3, 2024
fb538ca
feat: use rolldown minify (#73)
sapphi-red Dec 4, 2024
e34a446
fix: isolate `chunk.viteMetadata` values for each build (#74)
hi-ogawa Dec 6, 2024
fd1a993
perf: do less on js side for optimizer (#76)
sapphi-red Dec 10, 2024
2e665f1
chore: bump rolldown
sapphi-red Dec 11, 2024
7da6d3e
chore: handle oxc errors
sapphi-red Dec 11, 2024
52702fd
chore: change for latest native vite resolver plugin
sapphi-red Dec 6, 2024
858e93b
chore: getCombinedSourcemap is now supported
sapphi-red Dec 6, 2024
5989568
chore: set keepNames
sapphi-red Dec 6, 2024
176636a
chore: update sourcemap snapshot
sapphi-red Dec 11, 2024
df6d37a
chore: enable some define tests
sapphi-red Dec 11, 2024
c5b877e
chore: change for latest native json plugin
sapphi-red Dec 11, 2024
b3d6de2
chore: update modulePreloadPolyfill snapshot
sapphi-red Dec 11, 2024
ebb47e0
chore: reduce diff for Sourcemap::toUrl/Sourcemap::toString
sapphi-red Dec 11, 2024
c61731b
chore: make external test pass by manually polyfilling require
sapphi-red Dec 11, 2024
cc69de3
chore: remove workaround
sapphi-red Dec 11, 2024
c15d1f8
feat: use oxc for lowering (#77)
sapphi-red Dec 12, 2024
3b27992
feat: make esbuild optional peer dep (#78)
sapphi-red Dec 12, 2024
8a65f7f
fix(css): inline css insert for single quote `use strict` (#79)
underfin Dec 16, 2024
7394caa
chore: bump rolldown
sapphi-red Dec 16, 2024
af3588f
chore: bump rolldown
sapphi-red Dec 19, 2024
8218969
chore: update for oxc.jsx type change
sapphi-red Dec 19, 2024
6fa49d9
chore: update for PluginContext type change
sapphi-red Dec 19, 2024
1627bfd
fix: return transformed content as `moduleType: 'js'`
sapphi-red Dec 20, 2024
cceebb3
feat: use setPublicClassFields for useDefineForClassFields support
sapphi-red Dec 20, 2024
3fc53eb
fix: set `onlyRemoveTypeImports: false` by default
sapphi-red Dec 20, 2024
c8f1d48
chore: bump rolldown
sapphi-red Dec 20, 2024
f34e369
chore: tweak types
sapphi-red Dec 20, 2024
e998363
chore: update some snapshots
sapphi-red Dec 26, 2024
7f92857
chore: bump rolldown
sapphi-red Dec 26, 2024
8a4663c
chore: update snapshot
sapphi-red Dec 26, 2024
7b33137
chore: fix type
sapphi-red Dec 26, 2024
8022b7e
chore: disable rolldown define process.env.NODE_ENV
sapphi-red Dec 26, 2024
113bb8f
chore: suppress rolldown minifier warning
sapphi-red Dec 26, 2024
9a35f87
chore: use types from rolldown
sapphi-red Dec 26, 2024
34f5922
chore: remove lightningcss from optional peer dep
sapphi-red Dec 28, 2024
acff658
chore: format
sapphi-red Jan 9, 2025
1c5f162
fix: oxc esbuild transform option compat
sapphi-red Jan 10, 2025
6a75d5c
fix: use esbuildOptions.platform as rollupOptions.platform for compat
sapphi-red Jan 10, 2025
a088673
fix: generate sourcemap in oxc plugin
sapphi-red Jan 10, 2025
f239596
chore: bump rolldown
sapphi-red Jan 16, 2025
c73f23e
chore: fix types
sapphi-red Jan 16, 2025
1aa5c95
chore: skip a test due to bug in rolldown
sapphi-red Jan 16, 2025
f965b29
chore: tweak snapshots
sapphi-red Jan 16, 2025
a867533
refactor: use parseAst from rolldown (#81)
sapphi-red Jan 17, 2025
8167096
refactor: remove rollup from dependency
sapphi-red Jan 17, 2025
0bda4a8
fix: don't modify oxc options in each transform
sapphi-red Jan 17, 2025
d3a6837
feat: allow using parseAst from rollup with VITE_USE_LEGACY_PARSE_AST
sapphi-red Jan 17, 2025
428a920
fix: oxc esbuild jsx option compat
sapphi-red Jan 17, 2025
816c6e5
feat: allow `cssPlugin.transform` to be called
sapphi-red Jan 17, 2025
8a4e655
chore: export OxcOptions
sapphi-red Jan 17, 2025
861e87d
chore: export esbuildVersion for backward compat
sapphi-red Jan 22, 2025
ae012f7
fix: match optimizer entry by file name than facadeModuleId
sapphi-red Jan 22, 2025
e783056
chore: bump rolldown
sapphi-red Jan 23, 2025
97f8a49
Revert "chore: skip a test due to bug in rolldown"
sapphi-red Jan 23, 2025
f602ad4
chore: use `moduleResolution: bundler` for now
sapphi-red Jan 23, 2025
43ae93d
fix: double `export default` for txt files
sapphi-red Jan 23, 2025
05d773f
feat: convert esbuild plugin to rolldown plugin
sapphi-red Jan 23, 2025
9c98201
fix: incorrect optimizer file hash
sapphi-red Jan 24, 2025
4b28713
fix: buffer full reload messages
sapphi-red Jan 24, 2025
00bb96c
chore: bump rolldown
sapphi-red Jan 24, 2025
1b6b33c
fix: oxc transpile use normal options over tsconfig options
sapphi-red Jan 24, 2025
96fbf28
fix: slient output for runtime helper bundle
sapphi-red Jan 24, 2025
ab34d8e
chore: bump rolldown
sapphi-red Jan 28, 2025
6f619df
chore: add @babel/runtime for now
sapphi-red Jan 31, 2025
26df6a6
chore: dedupe OXC warnings
sapphi-red Jan 31, 2025
8fb03a2
chore: suppress optimizeDeps.esbuildOptions warning
sapphi-red Jan 31, 2025
eb5f631
chore: bump rolldown
sapphi-red Feb 5, 2025
3392735
chore: update snapshots
sapphi-red Feb 5, 2025
72e88c9
fix: set `oxc.jsx.development` when `esbuild.jsxDev` is set
sapphi-red Feb 5, 2025
8a0eef5
chore: update snapshots
sapphi-red Feb 6, 2025
c0a08a6
chore: fixes for newer rolldown
sapphi-red Feb 6, 2025
40af2d9
chore: format
sapphi-red Feb 6, 2025
512c795
chore: bump rolldown
sapphi-red Feb 7, 2025
07af24a
chore: use types from rolldown
sapphi-red Feb 7, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -173,8 +173,8 @@ jobs:
- name: Check formatting
run: pnpm prettier --write --log-level=warn . && git diff --exit-code

- name: Typecheck
run: pnpm run typecheck
# - name: Typecheck
# run: pnpm run typecheck

- name: Test docs
run: pnpm run test-docs
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/preview-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ permissions:
on:
push:
branches:
- main
- rolldown-v6
pull_request:
types: [opened, synchronize, labeled]

jobs:
preview:
if: >
github.repository == 'vitejs/vite' &&
github.repository == 'rolldown/vite' &&
(github.event_name == 'push' ||
(github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'trigger: preview')))
runs-on: ubuntu-latest
Expand All @@ -35,4 +35,4 @@ jobs:
working-directory: ./packages/vite
run: pnpm build

- run: pnpm dlx [email protected] publish --compact --pnpm ./packages/vite
- run: pnpm dlx [email protected] publish --pnpm ./packages/vite
2 changes: 1 addition & 1 deletion docs/_data/blog.data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ interface Post {
}

declare const data: Post[]
export { data }
export { type data }

export default createContentLoader('blog/*.md', {
// excerpt: true,
Expand Down
1 change: 1 addition & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ export default tseslint.config(
{
allowModules: [
'vite',
'esbuild',
'less',
'sass',
'sass-embedded',
Expand Down
13 changes: 13 additions & 0 deletions justfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
build-vite:
pnpm --filter vite run build-bundle

test-serve:
pnpm run test-serve

test-build:
pnpm run test-build

test: test-serve test-build

fmt:
pnpm --filter vite run format
1 change: 0 additions & 1 deletion packages/plugin-legacy/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
},
"scripts": {
"dev": "unbuild --stub",
"build": "unbuild && pnpm run patch-cjs",
"patch-cjs": "tsx ../../scripts/patchCJS.ts",
"prepublishOnly": "npm run build"
},
Expand Down
77 changes: 33 additions & 44 deletions packages/vite/LICENSE.md
Original file line number Diff line number Diff line change
Expand Up @@ -360,15 +360,11 @@ Repository: lukeed/polka

---------------------------------------

## @rollup/plugin-alias, @rollup/plugin-commonjs, @rollup/plugin-dynamic-import-vars, @rollup/pluginutils
## @rollup/plugin-alias, @rollup/plugin-dynamic-import-vars, @rollup/pluginutils
License: MIT
By: Johannes Stein
Repository: rollup/plugins

License: MIT
By: Rich Harris
Repository: rollup/plugins

License: MIT
By: LarsDenBakker
Repository: rollup/plugins
Expand Down Expand Up @@ -584,38 +580,6 @@ Repository: git+https://github.com/paulmillr/chokidar.git

---------------------------------------

## commondir, shell-quote
License: MIT
By: James Halliday
Repositories: http://github.com/substack/node-commondir.git, http://github.com/ljharb/shell-quote.git

> The MIT License
>
> Copyright (c) 2013 James Halliday ([email protected])
>
> Permission is hereby granted, free of charge,
> to any person obtaining a copy of this software and
> associated documentation files (the "Software"), to
> deal in the Software without restriction, including
> without limitation the rights to use, copy, modify,
> merge, publish, distribute, sublicense, and/or sell
> copies of the Software, and to permit persons to whom
> the Software is furnished to do so,
> subject to the following conditions:
>
> The above copyright notice and this permission notice
> shall be included in all copies or substantial portions of the Software.
>
> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
> EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
> OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
> IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR
> ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
> TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
> SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

---------------------------------------

## connect
License: MIT
By: TJ Holowaychuk, Douglas Christopher Wilson, Jonathan Ong, Tim Caswell
Expand Down Expand Up @@ -1298,13 +1262,6 @@ Repository: micromatch/is-glob

---------------------------------------

## is-reference
License: MIT
By: Rich Harris
Repository: git+https://github.com/Rich-Harris/is-reference.git

---------------------------------------

## isexe, which
License: ISC
By: Isaac Z. Schlueter
Expand Down Expand Up @@ -2147,6 +2104,38 @@ Repository: kevva/shebang-command

---------------------------------------

## shell-quote
License: MIT
By: James Halliday
Repository: http://github.com/ljharb/shell-quote.git

> The MIT License
>
> Copyright (c) 2013 James Halliday ([email protected])
>
> Permission is hereby granted, free of charge,
> to any person obtaining a copy of this software and
> associated documentation files (the "Software"), to
> deal in the Software without restriction, including
> without limitation the rights to use, copy, modify,
> merge, publish, distribute, sublicense, and/or sell
> copies of the Software, and to permit persons to whom
> the Software is furnished to do so,
> subject to the following conditions:
>
> The above copyright notice and this permission notice
> shall be included in all copies or substantial portions of the Software.
>
> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
> EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
> OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
> IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR
> ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
> TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
> SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

---------------------------------------

## sirv
License: MIT
By: Luke Edwards
Expand Down
1 change: 1 addition & 0 deletions packages/vite/index.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ const asyncFunctions = [
'createServer',
'preview',
'transformWithEsbuild',
'transformWithOxc',
'resolveConfig',
'optimizeDeps',
'formatPostcssSourceMap',
Expand Down
18 changes: 10 additions & 8 deletions packages/vite/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"type": "module",
"license": "MIT",
"author": "Evan You",
"description": "Native-ESM powered web dev build tool",
"description": "Vite on Rolldown preview",
"bin": {
"vite": "bin/vite.js"
},
Expand Down Expand Up @@ -85,9 +85,10 @@
},
"//": "READ CONTRIBUTING.md to understand what to put under deps vs. devDeps!",
"dependencies": {
"esbuild": "^0.24.2",
"@babel/runtime": "^7.26.0",
"lightningcss": "^1.28.2",
"postcss": "^8.5.1",
"rollup": "^4.30.1"
"rolldown": "1.0.0-beta.3-commit.558ea78"
},
"optionalDependencies": {
"fsevents": "~2.3.3"
Expand Down Expand Up @@ -117,12 +118,12 @@
"dotenv": "^16.4.7",
"dotenv-expand": "^12.0.1",
"es-module-lexer": "^1.6.0",
"esbuild": "^0.24.2",
"escape-html": "^1.0.3",
"estree-walker": "^3.0.3",
"etag": "^1.8.1",
"http-proxy": "^1.18.1",
"launch-editor-middleware": "^2.9.1",
"lightningcss": "^1.29.1",
"magic-string": "^0.30.17",
"mlly": "^1.7.4",
"mrmime": "^2.0.0",
Expand All @@ -137,6 +138,7 @@
"postcss-load-config": "^6.0.1",
"postcss-modules": "^6.0.1",
"resolve.exports": "^2.0.3",
"rollup": "^4.23.0",
"rollup-plugin-dts": "^6.1.1",
"rollup-plugin-esbuild": "^6.1.1",
"rollup-plugin-license": "^3.5.3",
Expand All @@ -155,9 +157,9 @@
},
"peerDependencies": {
"@types/node": "^18.0.0 || ^20.0.0 || >=22.0.0",
"esbuild": "^0.24.0",
"jiti": ">=1.21.0",
"less": "*",
"lightningcss": "^1.21.0",
"sass": "*",
"sass-embedded": "*",
"stylus": "*",
Expand All @@ -170,6 +172,9 @@
"@types/node": {
"optional": true
},
"esbuild": {
"optional": true
},
"jiti": {
"optional": true
},
Expand All @@ -188,9 +193,6 @@
"sugarss": {
"optional": true
},
"lightningcss": {
"optional": true
},
"terser": {
"optional": true
},
Expand Down
4 changes: 3 additions & 1 deletion packages/vite/rollup.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,8 @@ const nodeConfig = defineConfig({
/^vite\//,
'fsevents',
'rollup/parseAst',
'rolldown/parseAst',
'rolldown/experimental',
/^tsx\//,
/^#/,
...Object.keys(pkg.dependencies),
Expand Down Expand Up @@ -190,7 +192,7 @@ const moduleRunnerConfig = defineConfig({
external: [
'fsevents',
'lightningcss',
'rollup/parseAst',
'rolldown/parseAst',
...Object.keys(pkg.dependencies),
],
plugins: [
Expand Down
22 changes: 11 additions & 11 deletions packages/vite/rollup.dts.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ const pkg = JSON.parse(
const external = [
/^node:*/,
/^vite\//,
'rollup/parseAst',
'rolldown/parseAst',
'rolldown/experimental',
...Object.keys(pkg.dependencies),
...Object.keys(pkg.peerDependencies),
...Object.keys(pkg.devDependencies),
Expand Down Expand Up @@ -46,17 +47,16 @@ const identifierWithTrailingDollarRE = /\b(\w+)\$\d+\b/g
* the module that imports the identifer as a named import alias
*/
const identifierReplacements: Record<string, Record<string, string>> = {
rollup: {
Plugin$1: 'rollup.Plugin',
PluginContext$1: 'rollup.PluginContext',
MinimalPluginContext$1: 'rollup.MinimalPluginContext',
TransformPluginContext$1: 'rollup.TransformPluginContext',
TransformResult$1: 'rollup.TransformResult',
rolldown: {
Plugin$1: 'rolldown.Plugin',
PluginContext$1: 'rolldown.PluginContext',
MinimalPluginContext$1: 'rolldown.MinimalPluginContext',
TransformPluginContext$1: 'rolldown.TransformPluginContext',
TransformResult$1: 'rolldown.TransformResult',
},
esbuild: {
TransformResult$2: 'esbuild_TransformResult',
TransformOptions$1: 'esbuild_TransformOptions',
BuildOptions$1: 'esbuild_BuildOptions',
'rolldown/experimental': {
TransformOptions$1: 'rolldown_experimental_TransformOptions',
TransformResult$2: 'rolldown_experimental_TransformResult',
},
'node:https': {
Server$1: 'HttpsServer',
Expand Down
11 changes: 6 additions & 5 deletions packages/vite/src/node/__tests__/build.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import type {
RollupLog,
RollupOptions,
RollupOutput,
} from 'rollup'
} from 'rolldown'
import type { LibraryFormats, LibraryOptions } from '../build'
import {
build,
Expand Down Expand Up @@ -131,8 +131,8 @@ describe('build', () => {
{
"changed": [
"index",
"_foo",
"_bar",
"_foo",
"_baz.css",
],
"unchanged": [
Expand Down Expand Up @@ -861,11 +861,11 @@ test.for([true, false])(
([client, ssr, custom1, custom2] as RollupOutput[]).map(
(o) => o.output[0].code.split('\n').length,
),
).toEqual([2, 5, 2, 5])
).toEqual([1, 5, 1, 5])
},
)

test('adjust worker build error for worker.format', async () => {
test.skip('adjust worker build error for worker.format', async () => {
try {
await build({
root: resolve(__dirname, 'fixtures/worker-dynamic'),
Expand All @@ -886,7 +886,8 @@ test('adjust worker build error for worker.format', async () => {
expect.unreachable()
})

describe('onRollupLog', () => {
// rolldown does not append plugin name to the message automatically
describe.skip('onRollupLog', () => {
const pluginName = 'rollup-plugin-test'
const msgInfo = 'This is the INFO message.'
const msgWarn = 'This is the WARN message.'
Expand Down
4 changes: 2 additions & 2 deletions packages/vite/src/node/__tests__/environment.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import path from 'node:path'
import { describe, expect, onTestFinished, test } from 'vitest'
import type { RollupOutput } from 'rollup'
import type { RolldownOutput } from 'rolldown'
import { createServer } from '../server'
import type { InlineConfig } from '../config'
import { createBuilder } from '../build'
Expand Down Expand Up @@ -167,7 +167,7 @@ describe('custom environment conditions', () => {
const results: Record<string, unknown> = {}
for (const key of ['ssr', 'worker', 'custom1', 'custom1_2']) {
const output = await builder.build(builder.environments[key])
const chunk = (output as RollupOutput).output[0]
const chunk = (output as RolldownOutput).output[0]
const mod = await import(
path.join(
import.meta.dirname,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { describe, expect, test } from 'vitest'
import { parseAst } from 'rollup/parseAst'
import { assetImportMetaUrlPlugin } from '../../plugins/assetImportMetaUrl'
import { resolveConfig } from '../../config'
import { PartialEnvironment } from '../../baseEnvironment'
Expand All @@ -10,9 +9,9 @@ async function createAssetImportMetaurlPluginTransform() {
const environment = new PartialEnvironment('client', config)

return async (code: string) => {
// @ts-expect-error transform should exist
const result = await instance.transform.call(
{ environment, parse: parseAst },
// @ts-expect-error transform.handler should exist
const result = await instance.transform.handler.call(
{ environment },
code,
'foo.ts',
)
Expand Down
Loading
Loading