Skip to content

Commit 22bd8e5

Browse files
authored
feat: update rolldown to 1.0.0-beta.51 (#512)
1 parent 2cf8062 commit 22bd8e5

File tree

21 files changed

+163
-179
lines changed

21 files changed

+163
-179
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@
6565
"picocolors": "^1.1.1",
6666
"playwright-chromium": "^1.56.1",
6767
"prettier": "3.6.2",
68-
"rolldown": "1.0.0-beta.50",
68+
"rolldown": "1.0.0-beta.51",
6969
"rollup": "^4.43.0",
7070
"simple-git-hooks": "^2.13.1",
7171
"tsx": "^4.20.6",

packages/vite/package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -82,12 +82,12 @@
8282
},
8383
"//": "READ CONTRIBUTING.md to understand what to put under deps vs. devDeps!",
8484
"dependencies": {
85-
"@oxc-project/runtime": "0.97.0",
85+
"@oxc-project/runtime": "0.98.0",
8686
"fdir": "^6.5.0",
8787
"lightningcss": "^1.30.2",
8888
"picomatch": "^4.0.3",
8989
"postcss": "^8.5.6",
90-
"rolldown": "1.0.0-beta.50",
90+
"rolldown": "1.0.0-beta.51",
9191
"tinyglobby": "^0.2.15"
9292
},
9393
"optionalDependencies": {
@@ -97,9 +97,9 @@
9797
"@babel/parser": "^7.28.5",
9898
"@jridgewell/remapping": "^2.3.5",
9999
"@jridgewell/trace-mapping": "^0.3.31",
100-
"@oxc-project/types": "0.97.0",
100+
"@oxc-project/types": "0.98.0",
101101
"@polka/compression": "^1.0.0-next.25",
102-
"@rolldown/pluginutils": "^1.0.0-beta.46",
102+
"@rolldown/pluginutils": "1.0.0-beta.51",
103103
"@rollup/plugin-alias": "^5.1.1",
104104
"@rollup/plugin-commonjs": "28.0.6",
105105
"@rollup/plugin-dynamic-import-vars": "2.1.4",
@@ -139,7 +139,7 @@
139139
"postcss-modules": "^6.0.1",
140140
"premove": "^4.0.0",
141141
"resolve.exports": "^2.0.3",
142-
"rolldown-plugin-dts": "^0.17.5",
142+
"rolldown-plugin-dts": "^0.18.0",
143143
"rollup": "^4.43.0",
144144
"rollup-plugin-license": "^3.6.0",
145145
"sass": "^1.93.2",

packages/vite/src/node/build.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import type {
2222
WarningHandlerWithDefault,
2323
WatcherOptions,
2424
} from 'rolldown'
25-
import { loadFallbackPlugin as nativeLoadFallbackPlugin } from 'rolldown/experimental'
25+
import { viteLoadFallbackPlugin as nativeLoadFallbackPlugin } from 'rolldown/experimental'
2626
import type { EsbuildTarget } from '#types/internal/esbuildOptions'
2727
import type { RollupCommonJSOptions } from '#dep-types/commonjs'
2828
import type { RollupDynamicImportVarsOptions } from '#dep-types/dynamicImportVars'

packages/vite/src/node/index.ts

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,28 +3,19 @@ import {
33
parseAst as _parseAst,
44
parseAstAsync as _parseAstAsync,
55
} from 'rolldown/parseAst'
6-
import {
7-
type MinifyOptions,
8-
type MinifyResult,
9-
minify as minifySync,
10-
} from 'rolldown/experimental'
116
import type * as Rollup from '#types/internal/rollupTypeCompat'
127

138
export type { Rollup, Rolldown }
149
export { esmExternalRequirePlugin } from 'rolldown/plugins'
15-
export async function minify(
16-
filename: string,
17-
sourceText: string,
18-
options?: MinifyOptions | undefined | null,
19-
): Promise<MinifyResult> {
20-
return minifySync(filename, sourceText, options)
21-
}
22-
export { minifySync, type MinifyOptions, type MinifyResult }
2310
export {
24-
parseAsync as parse,
11+
parse,
2512
parseSync,
2613
type ParserOptions,
2714
type ParseResult,
15+
minify,
16+
minifySync,
17+
type MinifyOptions,
18+
type MinifyResult,
2819
} from 'rolldown/experimental'
2920

3021
/** @deprecated - use `parse` instead */
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
export { reactRefreshWrapperPlugin } from 'rolldown/experimental'
1+
export { viteReactRefreshWrapperPlugin as reactRefreshWrapperPlugin } from 'rolldown/experimental'

packages/vite/src/node/optimizer/scan.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import fs from 'node:fs'
22
import fsp from 'node:fs/promises'
33
import path from 'node:path'
44
import { performance } from 'node:perf_hooks'
5-
import { scan, transform } from 'rolldown/experimental'
5+
import { scan, transformSync } from 'rolldown/experimental'
66
import type { PartialResolvedId, Plugin } from 'rolldown'
77
import colors from 'picocolors'
88
import { glob } from 'tinyglobby'
@@ -393,7 +393,7 @@ function rolldownScanPlugin(
393393
let transpiledContents: string
394394
// transpile because `transformGlobImport` only expects js
395395
if (loader !== 'js') {
396-
const result = transform(id, contents, { lang: loader })
396+
const result = transformSync(id, contents, { lang: loader })
397397
if (result.errors.length > 0) {
398398
throw new AggregateError(result.errors, 'oxc transform error')
399399
}

packages/vite/src/node/plugins/define.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { transform } from 'rolldown/experimental'
1+
import { transformSync } from 'rolldown/experimental'
22
import type { ResolvedConfig } from '../config'
33
import type { Plugin } from '../plugin'
44
import { escapeRegex, isCSSRequest } from '../utils'
@@ -206,8 +206,11 @@ export async function replaceDefine(
206206
code: string,
207207
id: string,
208208
define: Record<string, string>,
209-
): Promise<{ code: string; map: ReturnType<typeof transform>['map'] | null }> {
210-
const result = transform(id, code, {
209+
): Promise<{
210+
code: string
211+
map: ReturnType<typeof transformSync>['map'] | null
212+
}> {
213+
const result = transformSync(id, code, {
211214
lang: 'js',
212215
sourceType: 'module',
213216
define,

packages/vite/src/node/plugins/dynamicImportVars.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { init, parse as parseImports } from 'es-module-lexer'
44
import type { ImportSpecifier } from 'es-module-lexer'
55
import { parseAst } from 'rolldown/parseAst'
66
import { dynamicImportToGlob } from '@rollup/plugin-dynamic-import-vars'
7-
import { dynamicImportVarsPlugin as nativeDynamicImportVarsPlugin } from 'rolldown/experimental'
7+
import { viteDynamicImportVarsPlugin as nativeDynamicImportVarsPlugin } from 'rolldown/experimental'
88
import { exactRegex } from '@rolldown/pluginutils'
99
import { type Plugin, perEnvironmentPlugin } from '../plugin'
1010
import type { ResolvedConfig } from '../config'

packages/vite/src/node/plugins/importAnalysisBuild.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import type {
66
} from 'es-module-lexer'
77
import { init, parse as parseImports } from 'es-module-lexer'
88
import type { SourceMap } from 'rolldown'
9-
import { buildImportAnalysisPlugin as nativeBuildImportAnalysisPlugin } from 'rolldown/experimental'
9+
import { viteBuildImportAnalysisPlugin as nativeBuildImportAnalysisPlugin } from 'rolldown/experimental'
1010
import type { RawSourceMap } from '@jridgewell/remapping'
1111
import convertSourceMap from 'convert-source-map'
1212
import { exactRegex } from '@rolldown/pluginutils'

packages/vite/src/node/plugins/importMetaGlob.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import MagicString from 'magic-string'
1515
import { stringifyQuery } from 'ufo'
1616
import { parseAstAsync } from 'rolldown/parseAst'
1717
import { escapePath, glob } from 'tinyglobby'
18-
import { importGlobPlugin as nativeImportGlobPlugin } from 'rolldown/experimental'
18+
import { viteImportGlobPlugin as nativeImportGlobPlugin } from 'rolldown/experimental'
1919
import type { GeneralImportGlobOptions } from '#types/importGlob'
2020
import type { Plugin } from '../plugin'
2121
import type { EnvironmentModuleNode } from '../server/moduleGraph'

0 commit comments

Comments
 (0)