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

Rolldown-Vite #84

Draft
wants to merge 24 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
a307602
refactor: `[hookName].handler` in plugins
sapphi-red Mar 6, 2025
0bcacd2
feat: implement hook filters
sapphi-red Mar 7, 2025
bc4995f
chore: add rolldown as dependency
sapphi-red Mar 7, 2025
5a160a5
feat: use rolldown in the dep optimizer
sapphi-red Mar 7, 2025
ee0b21a
feat: convert `optimizeDep.esbuildOptions` to `optimizeDep.rollupOpti…
sapphi-red Mar 7, 2025
4d30bb5
feat: use rolldown to bundle config
sapphi-red Mar 7, 2025
0564a35
feat: use `parseAst` from rolldown
sapphi-red Mar 7, 2025
2ad9273
feat: use rolldown for build
sapphi-red Mar 7, 2025
bc89f37
feat: use rolldown builtin OXC minifier by default
sapphi-red Mar 7, 2025
e6174f8
feat: use OXC for transform
sapphi-red Mar 7, 2025
34ce822
feat: use OXC for define plugin
sapphi-red Mar 7, 2025
dbb2779
feat: use lightningcss by default for cssMinify
sapphi-red Mar 7, 2025
4cfd831
refactor: make esbuild optional peer dependency
sapphi-red Mar 7, 2025
1b7a95f
perf: use filter for plugins
sapphi-red Mar 7, 2025
c8ced29
refactor: skip hook filter inject in build
sapphi-red Mar 7, 2025
fe6c8af
perf: add `experimental.enableNativePlugin`
sapphi-red Mar 7, 2025
1cff7aa
feat: add an new option to disable build report
sapphi-red Mar 7, 2025
3839d94
fix: buffer full reload messages
sapphi-red Mar 7, 2025
3e81f9e
chore: enable continuous release
sapphi-red Mar 7, 2025
aa03809
fix: remove duplicate `createRequire` in optimizer (#86)
hi-ogawa Mar 10, 2025
078a640
chore: bump rolldown
sapphi-red Mar 10, 2025
ea36743
chore: set `ROLLDOWN_OPTIONS_VALIDATION=loose` for vitepress
sapphi-red Mar 10, 2025
a974a4a
fix(optimizer): externalize as absolute
sapphi-red Mar 17, 2025
fa33494
ci: update workflows
sapphi-red Mar 17, 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
2 changes: 1 addition & 1 deletion .github/workflows/issue-close-require.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:

jobs:
close-issues:
if: github.repository == 'vitejs/vite'
if: github.repository == 'vitejs/rolldown-vite'
runs-on: ubuntu-latest
steps:
- name: needs reproduction
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/issue-labeled.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:

jobs:
reply-labeled:
if: github.repository == 'vitejs/vite'
if: github.repository == 'vitejs/rolldown-vite'
runs-on: ubuntu-latest
steps:
- name: contribution welcome
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-vite
pull_request:
types: [opened, synchronize, labeled]

jobs:
preview:
if: >
github.repository == 'vitejs/vite' &&
github.repository == 'vitejs/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 .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ on:
jobs:
publish:
# prevents this action from running on forks
if: github.repository == 'vitejs/vite'
if: github.repository == 'vitejs/rolldown-vite'
runs-on: ubuntu-latest
permissions:
contents: read
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release-tag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ on:

jobs:
release:
if: github.repository == 'vitejs/vite'
if: github.repository == 'vitejs/rolldown-vite'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -45,4 +45,4 @@ jobs:
with:
tag_name: ${{ github.ref }}
body: |
Please refer to [CHANGELOG.md](https://github.com/vitejs/vite/blob/${{ github.ref_name }}/packages/${{ steps.tag.outputs.pkgName }}/CHANGELOG.md) for details.
Please refer to [CHANGELOG.md](https://github.com/vitejs/rolldown-vite/blob/${{ github.ref_name }}/packages/${{ steps.tag.outputs.pkgName }}/CHANGELOG.md) for details.
2 changes: 1 addition & 1 deletion .github/workflows/semantic-pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:

jobs:
main:
if: github.repository == 'vitejs/vite'
if: github.repository == 'vitejs/rolldown-vite'
runs-on: ubuntu-latest
name: Semantic Pull Request
steps:
Expand Down
3 changes: 3 additions & 0 deletions docs/.vitepress/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ import {
} from 'vitepress-plugin-group-icons'
import { buildEnd } from './buildEnd.config'

// NOTE: allow additional options to be passed to rolldown for now
process.env.ROLLDOWN_OPTIONS_VALIDATION = 'loose'

const ogDescription = 'Next Generation Frontend Tooling'
const ogImage = 'https://vite.dev/og-image.jpg'
const ogTitle = 'Vite'
Expand Down
4 changes: 2 additions & 2 deletions docs/_data/blog.data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ interface Post {
}
}

declare const data: Post[]
export { data }
// NOTE: https://github.com/rolldown/rolldown/issues/3048, https://github.com/oxc-project/oxc/issues/7951
export declare const data: Post[]

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
4 changes: 2 additions & 2 deletions packages/plugin-legacy/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
}
},
"scripts": {
"dev": "unbuild --stub",
"build": "unbuild && pnpm run patch-cjs",
"//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
21 changes: 12 additions & 9 deletions packages/vite/package.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"name": "vite",
"name": "rolldown-vite",
"version": "6.2.1",
"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.25.0",
"@oxc-project/runtime": "^0.58.1",
"lightningcss": "^1.29.1",
"postcss": "^8.5.3",
"rollup": "^4.30.1"
"rolldown": "1.0.0-beta.4-commit.308f68b"
},
"optionalDependencies": {
"fsevents": "~2.3.3"
Expand All @@ -96,6 +97,7 @@
"@ampproject/remapping": "^2.3.0",
"@babel/parser": "^7.26.9",
"@jridgewell/trace-mapping": "^0.3.25",
"@oxc-project/types": "^0.58.1",
"@polka/compression": "^1.0.0-next.25",
"@rollup/plugin-alias": "^5.1.1",
"@rollup/plugin-commonjs": "^28.0.2",
Expand All @@ -117,12 +119,12 @@
"dotenv": "^16.4.7",
"dotenv-expand": "^12.0.1",
"es-module-lexer": "^1.6.0",
"esbuild": "^0.25.0",
"escape-html": "^1.0.3",
"estree-walker": "^3.0.3",
"etag": "^1.8.1",
"http-proxy": "^1.18.1",
"launch-editor-middleware": "^2.10.0",
"lightningcss": "^1.29.1",
"magic-string": "^0.30.17",
"mlly": "^1.7.4",
"mrmime": "^2.0.1",
Expand All @@ -137,6 +139,7 @@
"postcss-load-config": "^6.0.1",
"postcss-modules": "^6.0.1",
"resolve.exports": "^2.0.3",
"rollup": "^4.30.1",
"rollup-plugin-dts": "^6.1.1",
"rollup-plugin-esbuild": "^6.2.1",
"rollup-plugin-license": "^3.6.0",
Expand All @@ -155,9 +158,9 @@
},
"peerDependencies": {
"@types/node": "^18.0.0 || ^20.0.0 || >=22.0.0",
"esbuild": "^0.25.0",
"jiti": ">=1.21.0",
"less": "*",
"lightningcss": "^1.21.0",
"sass": "*",
"sass-embedded": "*",
"stylus": "*",
Expand All @@ -170,6 +173,9 @@
"@types/node": {
"optional": true
},
"esbuild": {
"optional": true
},
"jiti": {
"optional": true
},
Expand All @@ -188,9 +194,6 @@
"sugarss": {
"optional": true
},
"lightningcss": {
"optional": true
},
"terser": {
"optional": true
},
Expand Down
5 changes: 3 additions & 2 deletions packages/vite/rollup.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,8 @@ const nodeConfig = defineConfig({
external: [
/^vite\//,
'fsevents',
'rollup/parseAst',
'rolldown/parseAst',
'rolldown/experimental',
/^tsx\//,
/^#/,
...Object.keys(pkg.dependencies),
Expand Down Expand Up @@ -190,7 +191,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
Loading
Loading