Skip to content

Commit

Permalink
chore: bump rolldown and resolve all relative path with native plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
sapphi-red committed Oct 1, 2024
1 parent 028a3f5 commit e4ec6bc
Show file tree
Hide file tree
Showing 5 changed files with 204 additions and 199 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
"simple-git-hooks": "^2.11.1",
"tslib": "^2.7.0",
"tsx": "^4.19.1",
"typescript": "^5.5.3",
"typescript": "^5.6.2",
"typescript-eslint": "^8.6.0",
"vite": "workspace:*",
"vitest": "^2.1.1"
Expand Down
2 changes: 1 addition & 1 deletion packages/vite/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@
"dependencies": {
"esbuild": "^0.24.0",
"postcss": "^8.4.47",
"rolldown": "https://pkg.pr.new/rolldown@4caa0a9",
"rolldown": "https://pkg.pr.new/rolldown@9a0db67",
"rollup": "^4.20.0"
},
"optionalDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/vite/src/module-runner/runner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@ export class ModuleRunner {
dirname: isWindows ? toWindowsPath(dirname) : dirname,
url: href,
env: this.envProxy,
resolve(_id, _parent) {
resolve(_id, _parent?) {
throw new Error(
'[module runner] "import.meta.resolve" is not supported.',
)
Expand Down
9 changes: 7 additions & 2 deletions packages/vite/src/node/plugins/resolve.ts
Original file line number Diff line number Diff line change
Expand Up @@ -191,14 +191,19 @@ export function filteredResolvePlugin(
options(option) {
option.resolve ??= {}
option.resolve.extensions = this.environment.config.resolve.extensions
option.resolve.extensionAlias = {
'.js': ['.ts', '.tsx', '.js'],
'.jsx': ['.ts', '.tsx', '.jsx'],
'.mjs': ['.mts', '.mjs'],
'.cjs': ['.cts', '.cjs'],
}
},
resolveId: {
filter: {
id: {
exclude: [
// relative paths without query
// also exclude path ending with .[cm]?jsx? (for typescript moduleResolution=nodenext)
/^\.\.?[/\\](?!.*\.[cm]?jsx?$)[^?]+$/,
/^\.\.?[/\\][^?]+$/,
/^(?:\0|\/?virtual:)/,
],
},
Expand Down
Loading

0 comments on commit e4ec6bc

Please sign in to comment.