You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/guide/rolldown.md
+48-2Lines changed: 48 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,6 +2,8 @@
2
2
3
3
Vite is planning to integrate [Rolldown](https://rolldown.rs), a Rust-powered JavaScript bundler, to improve build performance and capabilities.
4
4
5
+
<YouTubeVideovideoId="RRjfm8cMveQ" />
6
+
5
7
## What is Rolldown?
6
8
7
9
Rolldown is a modern, high-performance JavaScript bundler written in Rust. It's designed as a drop-in replacement for Rollup, aiming to provide significant performance improvements while maintaining compatibility with the existing ecosystem.
@@ -30,7 +32,18 @@ For additional insights on the motivations behind Rolldown, see the [reasons why
30
32
31
33
## How to Try Rolldown
32
34
33
-
The rolldown-powered version of Vite is currently available as a separate package called `rolldown-vite`. You can try it by adding package overrides to your `package.json`:
35
+
The rolldown-powered version of Vite is currently available as a separate package called `rolldown-vite`. If you have `vite` as a direct dependency, you can alias the `vite` package to `rolldown-vite` in your project's `package.json`, which should result in a drop-in replacement.
36
+
37
+
```json
38
+
{
39
+
"dependencies": {
40
+
"vite": "^6.0.0"// [!code --]
41
+
"vite": "npm:rolldown-vite@latest"// [!code ++]
42
+
}
43
+
}
44
+
```
45
+
46
+
If you use a Vitepress or a meta framework that has Vite as peer dependency, you have to override the `vite` dependency in your `package.json`, which works slightly different depending on your package manager:
34
47
35
48
:::code-group
36
49
@@ -86,12 +99,39 @@ Rolldown throws an error when unknown or invalid options are passed. Because som
86
99
87
100
If you don't pass the option in yourself, this must be fixed by the utilized framework. You can suppress this error in the meantime by setting the `ROLLDOWN_OPTIONS_VALIDATION=loose` environment variable.
88
101
89
-
## Enabling Native Plugins
102
+
## Performance
103
+
104
+
`rolldown-vite` is focused on ensuring compatibility with the existing ecosystem, so defaults are geared towards a smooth transition. You can get further performance gains by switching over to faster Rust-based internal plugins and other customizations.
105
+
106
+
### Enabling Native Plugins
90
107
91
108
Thanks to Rolldown and Oxc, various internal Vite plugins, such as the alias or resolve plugin, have been converted to Rust. At the time of writing, using these plugins is not enabled by default, as their behavior may differ from the JavaScript versions.
92
109
93
110
To test them, you can set the `experimental.enableNativePlugin` option to `true` in your Vite config.
94
111
112
+
### `withFilter` Wrapper
113
+
114
+
Plugin authors have the option to use the [hook filter feature](#hook-filter-feature) to reduce the communication overhead between the Rust and JavaScript runtimes.
115
+
But in case some of the used plugins are not using this feature (yet) but you still want to benefit from it, you can use the `withFilter` wrapper to wrap the plugin with a filter yourself.
116
+
117
+
```js
118
+
// In your vite.config.ts
119
+
import { withFilter, defineConfig } from'vite'
120
+
importsvgrfrom'vite-plugin-svgr'
121
+
122
+
exportdefaultdefineConfig({
123
+
plugins: [
124
+
// Load the `svgr` plugin only for files which end in `.svg?react`
125
+
withFilter(
126
+
svgr({
127
+
/*...*/
128
+
}),
129
+
{ load: { id:/\.svg?react$/ } },
130
+
),
131
+
],
132
+
})
133
+
```
134
+
95
135
## Reporting Issues
96
136
97
137
Since this is an experimental integration, you may encounter issues. If you do, please report them in the [`vitejs/rolldown-vite`](https://github.com/vitejs/rolldown-vite) repository, **not the main Vite repository**.
@@ -104,6 +144,12 @@ When [reporting issues](https://github.com/vitejs/rolldown-vite/issues/new), ple
104
144
105
145
For real-time discussions and troubleshooting, make sure to join the [Rolldown Discord](https://chat.rolldown.rs/).
106
146
147
+
## Versioning Policy
148
+
149
+
The versioning policy for `rolldown-vite` aligns its major and minor versions with those of the normal Vite package. This synchronization ensures that features present in a specific normal Vite minor release are also included in the corresponding `rolldown-vite` minor release. However, it's important to note that patch versions are not synchronized between the two projects. If you're wondering whether a specific change from normal Vite has been included in `rolldown-vite`, you can always check [`rolldown-vite`'s separate changelog](https://github.com/vitejs/rolldown-vite/blob/rolldown-vite/packages/vite/CHANGELOG.md) for confirmation.
150
+
151
+
Furthermore, please be aware that `rolldown-vite` itself is considered experimental. Due to its experimental nature, breaking changes might be introduced even within its patch versions. Additionally, please note that `rolldown-vite` only receives updates for its most recent minor version. Even for important security or bug fixes, patches are not created for older major or minor versions.
152
+
107
153
## Future Plans
108
154
109
155
The `rolldown-vite` package is a temporary solution to gather feedback and stabilize the Rolldown integration. In the future, this functionality will be merged back into the main Vite repository.
Copy file name to clipboardExpand all lines: docs/guide/static-deploy.md
+2-54Lines changed: 2 additions & 54 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -63,59 +63,7 @@ Now the `preview` command will launch the server at `http://localhost:8080`.
63
63
64
64
2. Go to your GitHub Pages configuration in the repository settings page and choose the source of deployment as "GitHub Actions", this will lead you to create a workflow that builds and deploys your project, a sample workflow that installs dependencies and builds using npm is provided:
65
65
66
-
```yml
67
-
# Simple workflow for deploying static content to GitHub Pages
68
-
name: Deploy static content to Pages
69
-
70
-
on:
71
-
# Runs on pushes targeting the default branch
72
-
push:
73
-
branches: ['main']
74
-
75
-
# Allows you to run this workflow manually from the Actions tab
76
-
workflow_dispatch:
77
-
78
-
# Sets the GITHUB_TOKEN permissions to allow deployment to GitHub Pages
79
-
permissions:
80
-
contents: read
81
-
pages: write
82
-
id-token: write
83
-
84
-
# Allow one concurrent deployment
85
-
concurrency:
86
-
group: 'pages'
87
-
cancel-in-progress: true
88
-
89
-
jobs:
90
-
# Single deploy job since we're just deploying
91
-
deploy:
92
-
environment:
93
-
name: github-pages
94
-
url: ${{ steps.deployment.outputs.page_url }}
95
-
runs-on: ubuntu-latest
96
-
steps:
97
-
- name: Checkout
98
-
uses: actions/checkout@v4
99
-
- name: Set up Node
100
-
uses: actions/setup-node@v4
101
-
with:
102
-
node-version: 20
103
-
cache: 'npm'
104
-
- name: Install dependencies
105
-
run: npm ci
106
-
- name: Build
107
-
run: npm run build
108
-
- name: Setup Pages
109
-
uses: actions/configure-pages@v4
110
-
- name: Upload artifact
111
-
uses: actions/upload-pages-artifact@v3
112
-
with:
113
-
# Upload dist folder
114
-
path: './dist'
115
-
- name: Deploy to GitHub Pages
116
-
id: deployment
117
-
uses: actions/deploy-pages@v4
118
-
```
66
+
<<< ./static-deploy-github-pages.yaml#content
119
67
120
68
## GitLab Pages and GitLab CI
121
69
@@ -128,7 +76,7 @@ Now the `preview` command will launch the server at `http://localhost:8080`.
128
76
2. Create a file called `.gitlab-ci.yml` in the root of your project with the content below. This will build and deploy your site whenever you make changes to your content:
* fix(create-vite): adding an interactive flag to force interactivity (#19875) ([608457c](https://github.com/vitejs/vite/commit/608457cd03ce593492abfe007e20468387c4c895)), closes [#19875](https://github.com/vitejs/vite/issues/19875)
0 commit comments