Skip to content

Commit e9f2d8d

Browse files
committed
Merge commit '61b6b96b191c6071b9c574ad4c795f97f2646f18' into rolldown-vite
2 parents 3fa7588 + 61b6b96 commit e9f2d8d

30 files changed

+974
-1712
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ jobs:
6363
strategy:
6464
matrix:
6565
os: [ubuntu-latest]
66-
node_version: [20, 22]
66+
node_version: [20, 22, 24]
6767
include:
6868
# Active LTS + other OS
6969
- os: macos-latest

docs/config/shared-options.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -466,7 +466,7 @@ See [here](/guide/env-and-mode#env-files) for more about environment files.
466466
- **Type:** `string | string[]`
467467
- **Default:** `VITE_`
468468

469-
Env variables starting with `envPrefix` will be exposed to your client source code via import.meta.env.
469+
Env variables starting with `envPrefix` will be exposed to your client source code via `import.meta.env`.
470470

471471
:::warning SECURITY NOTES
472472
`envPrefix` should not be set as `''`, which will expose all your env variables and cause unexpected leaking of sensitive information. Vite will throw an error when detecting `''`.

docs/guide/api-environment-frameworks.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,7 @@ export default {
329329
}
330330
```
331331
332-
Plugins can also define a `buildApp` hook. Order `'pre'` and `null'` are executed before the configured `builder.buildApp`, and order `'post'` hooks are executed after it. `environment.isBuilt` can be used to check if an environment has already being build.
332+
Plugins can also define a `buildApp` hook. Order `'pre'` and `null` are executed before the configured `builder.buildApp`, and order `'post'` hooks are executed after it. `environment.isBuilt` can be used to check if an environment has already being build.
333333
334334
## Environment Agnostic Code
335335

docs/guide/performance.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ Keeping Vite fast with a growing codebase is about reducing the amount of work f
115115
Examples of doing less work:
116116

117117
- Use CSS instead of Sass/Less/Stylus when possible (nesting can be handled by PostCSS)
118-
- Don't transform SVGs into UI framework components (React, Vue, etc). Import them as strings or URLs instead.
118+
- Don't transform SVGs into UI framework components (React, Vue, etc.). Import them as strings or URLs instead.
119119
- When using `@vitejs/plugin-react`, avoid configuring the Babel options, so it skips the transformation during build (only esbuild will be used).
120120

121121
Examples of using native tooling:

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@
6868
"playwright-chromium": "^1.50.1",
6969
"premove": "^4.0.0",
7070
"prettier": "3.5.3",
71-
"rollup": "^4.34.9",
71+
"rollup": "^4.40.0",
7272
"rollup-plugin-esbuild": "^6.2.1",
7373
"simple-git-hooks": "^2.13.0",
7474
"tslib": "^2.8.1",
@@ -137,6 +137,7 @@
137137
"bcrypt",
138138
"esbuild",
139139
"playwright-chromium",
140+
"rolldown",
140141
"simple-git-hooks",
141142
"workerd"
142143
]

packages/create-vite/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
#!/usr/bin/env node
22

3-
import './dist/index.mjs'
3+
import './dist/index.js'

packages/create-vite/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
"dist"
1515
],
1616
"scripts": {
17-
"dev": "unbuild --stub",
18-
"build": "unbuild",
17+
"dev": "tsdown --watch",
18+
"build": "tsdown",
1919
"typecheck": "tsc --noEmit",
2020
"prepublishOnly": "npm run build"
2121
},
@@ -37,6 +37,6 @@
3737
"cross-spawn": "^7.0.6",
3838
"mri": "^1.2.0",
3939
"picocolors": "^1.1.1",
40-
"unbuild": "^3.5.0"
40+
"tsdown": "^0.11.12"
4141
}
4242
}

packages/create-vite/tsconfig.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,17 @@
11
{
2-
"include": ["build.config.ts", "src", "__tests__"],
2+
"include": ["tsdown.config.ts", "src", "__tests__"],
33
"compilerOptions": {
44
"outDir": "dist",
55
"target": "ES2023",
66
"module": "Preserve",
77
"moduleResolution": "bundler",
8+
"allowImportingTsExtensions": true,
89
"strict": true,
910
"skipLibCheck": true,
1011
"declaration": false,
1112
"sourceMap": false,
1213
"noUnusedLocals": true,
13-
"esModuleInterop": true
14+
"esModuleInterop": true,
15+
"noEmit": true
1416
}
1517
}

packages/create-vite/build.config.ts renamed to packages/create-vite/tsdown.config.ts

Lines changed: 19 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,27 @@
11
import path from 'node:path'
22
import url from 'node:url'
3-
import { defineBuildConfig } from 'unbuild'
4-
import licensePlugin from '../vite/rollupLicensePlugin'
3+
import { defineConfig } from 'tsdown'
4+
import licensePlugin from '../vite/rollupLicensePlugin.ts'
55

66
const __dirname = path.dirname(url.fileURLToPath(import.meta.url))
77

8-
export default defineBuildConfig({
9-
entries: ['src/index'],
10-
clean: true,
11-
rollup: {
12-
inlineDependencies: true,
13-
esbuild: {
14-
target: 'node20',
15-
minify: true,
16-
},
17-
},
18-
hooks: {
19-
'rollup:options'(_ctx, options) {
20-
options.plugins = [
21-
options.plugins,
22-
licensePlugin(
23-
path.resolve(__dirname, './LICENSE'),
24-
'create-vite license',
25-
'create-vite',
26-
'# License of the files in the directories starting with "template-" in create-vite\n' +
27-
'The files in the directories starting with "template-" in create-vite and files\n' +
28-
'generated from those files are licensed under the CC0 1.0 Universal license:\n\n' +
29-
cc0LicenseText +
30-
'\n\n',
31-
),
32-
]
33-
},
34-
},
35-
})
8+
export default defineConfig(() => ({
9+
entry: ['src/index.ts'],
10+
target: 'node20',
11+
minify: true,
12+
plugins: [
13+
licensePlugin(
14+
path.resolve(__dirname, './LICENSE'),
15+
'create-vite license',
16+
'create-vite',
17+
'# License of the files in the directories starting with "template-" in create-vite\n' +
18+
'The files in the directories starting with "template-" in create-vite and files\n' +
19+
'generated from those files are licensed under the CC0 1.0 Universal license:\n\n' +
20+
cc0LicenseText +
21+
'\n\n',
22+
),
23+
],
24+
}))
3625

3726
const cc0LicenseText = `
3827
CC0 1.0 Universal

packages/plugin-legacy/build.config.ts

Lines changed: 0 additions & 14 deletions
This file was deleted.

0 commit comments

Comments
 (0)