Skip to content

Commit

Permalink
feat: upgrade rollup to 4.2.0 and use parseAstAsync (#14821)
Browse files Browse the repository at this point in the history
  • Loading branch information
sapphi-red committed Oct 31, 2023
1 parent 884365a commit 86a5356
Show file tree
Hide file tree
Showing 4 changed files with 79 additions and 79 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
"playwright-chromium": "^1.39.0",
"prettier": "3.0.3",
"rimraf": "^5.0.5",
"rollup": "^4.1.4",
"rollup": "^4.2.0",
"simple-git-hooks": "^2.9.0",
"tslib": "^2.6.2",
"tsx": "^3.14.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/vite/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
"dependencies": {
"esbuild": "^0.19.3",
"postcss": "^8.4.31",
"rollup": "^4.1.4"
"rollup": "^4.2.0"
},
"optionalDependencies": {
"fsevents": "~2.3.3"
Expand Down
4 changes: 2 additions & 2 deletions packages/vite/src/node/ssr/ssrTransform.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import type {
import { extract_names as extractNames } from 'periscopic'
import { walk as eswalk } from 'estree-walker'
import type { RawSourceMap } from '@ampproject/remapping'
import { parseAst as rollupParseAst } from 'rollup/parseAst'
import { parseAstAsync as rollupParseAstAsync } from 'rollup/parseAst'
import type { TransformResult } from '../server/transformRequest'
import { combineSourcemaps } from '../utils'
import { isJSONRequest } from '../plugins/json'
Expand Down Expand Up @@ -75,7 +75,7 @@ async function ssrTransformScript(

let ast: any
try {
ast = rollupParseAst(code)
ast = await rollupParseAstAsync(code)
} catch (err) {
if (!err.loc || !err.loc.line) throw err
const line = err.loc.line
Expand Down
Loading

0 comments on commit 86a5356

Please sign in to comment.