Skip to content

Commit b022d4b

Browse files
committed
chore: bump rolldown and resolve all relative path with native plugin
1 parent 119708f commit b022d4b

File tree

5 files changed

+241
-288
lines changed

5 files changed

+241
-288
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@
7474
"simple-git-hooks": "^2.11.1",
7575
"tslib": "^2.7.0",
7676
"tsx": "^4.19.1",
77-
"typescript": "^5.5.3",
77+
"typescript": "^5.6.2",
7878
"typescript-eslint": "^8.8.0",
7979
"vite": "workspace:*",
8080
"vitest": "^2.1.2"

packages/vite/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@
8787
"dependencies": {
8888
"esbuild": "^0.24.0",
8989
"postcss": "^8.4.47",
90-
"rolldown": "https://pkg.pr.new/rolldown@4caa0a9",
90+
"rolldown": "https://pkg.pr.new/rolldown@9a0db67",
9191
"rollup": "^4.22.5"
9292
},
9393
"optionalDependencies": {

packages/vite/src/module-runner/runner.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,7 @@ export class ModuleRunner {
345345
dirname: isWindows ? toWindowsPath(dirname) : dirname,
346346
url: href,
347347
env: this.envProxy,
348-
resolve(_id, _parent) {
348+
resolve(_id, _parent?) {
349349
throw new Error(
350350
'[module runner] "import.meta.resolve" is not supported.',
351351
)

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

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -192,14 +192,19 @@ export function filteredResolvePlugin(
192192
options(option) {
193193
option.resolve ??= {}
194194
option.resolve.extensions = this.environment.config.resolve.extensions
195+
option.resolve.extensionAlias = {
196+
'.js': ['.ts', '.tsx', '.js'],
197+
'.jsx': ['.ts', '.tsx', '.jsx'],
198+
'.mjs': ['.mts', '.mjs'],
199+
'.cjs': ['.cts', '.cjs'],
200+
}
195201
},
196202
resolveId: {
197203
filter: {
198204
id: {
199205
exclude: [
200206
// relative paths without query
201-
// also exclude path ending with .[cm]?jsx? (for typescript moduleResolution=nodenext)
202-
/^\.\.?[/\\](?!.*\.[cm]?jsx?$)[^?]+$/,
207+
/^\.\.?[/\\][^?]+$/,
203208
/^(?:\0|\/?virtual:)/,
204209
],
205210
},

0 commit comments

Comments
 (0)