Skip to content

Commit 00b3595

Browse files
fix: revert alias handling for nitro-v2-vite-plugin (#5378)
1 parent e94e9c7 commit 00b3595

File tree

6 files changed

+16
-47
lines changed

6 files changed

+16
-47
lines changed

packages/nitro-v2-vite-plugin/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
},
4141
"type": "module",
4242
"types": "dist/esm/index.d.ts",
43+
"main": "dist/cjs/index.cjs",
4344
"module": "dist/esm/index.js",
4445
"exports": {
4546
".": {
@@ -60,8 +61,7 @@
6061
},
6162
"dependencies": {
6263
"nitropack": "^2.12.6",
63-
"pathe": "^2.0.3",
64-
"h3-v1": "npm:h3@^1.15.4"
64+
"pathe": "^2.0.3"
6565
},
6666
"peerDependencies": {
6767
"vite": ">=7.0.0"

packages/nitro-v2-vite-plugin/src/index.ts

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import { createRequire } from 'node:module'
21
import { build, copyPublicAssets, createNitro, prepare } from 'nitropack'
32
import { dirname, resolve } from 'pathe'
43

@@ -16,7 +15,6 @@ function isFullUrl(str: string): boolean {
1615
return false
1716
}
1817
}
19-
const require = createRequire(import.meta.url)
2018

2119
export function nitroV2Plugin(nitroConfig?: NitroConfig): Array<PluginOption> {
2220
let resolvedConfig: ResolvedConfig
@@ -94,7 +92,6 @@ export function nitroV2Plugin(nitroConfig?: NitroConfig): Array<PluginOption> {
9492

9593
await builder.build(client)
9694
await builder.build(server)
97-
const h3v1 = require.resolve('h3-v1')
9895

9996
const virtualEntry = '#tanstack/start/entry'
10097
const baseURL = !isFullUrl(resolvedConfig.base)
@@ -113,22 +110,7 @@ export function nitroV2Plugin(nitroConfig?: NitroConfig): Array<PluginOption> {
113110
renderer: virtualEntry,
114111
rollupConfig: {
115112
...nitroConfig?.rollupConfig,
116-
plugins: [
117-
virtualBundlePlugin(ssrBundle) as any,
118-
{
119-
name: 'resolve',
120-
resolveId(source, importer) {
121-
if (
122-
source === 'h3' &&
123-
(importer?.includes('nitropack') ||
124-
importer?.includes(virtualEntry))
125-
) {
126-
return h3v1
127-
}
128-
return null
129-
},
130-
},
131-
],
113+
plugins: [virtualBundlePlugin(ssrBundle) as any],
132114
},
133115
virtual: {
134116
...nitroConfig?.virtual,

packages/nitro-v2-vite-plugin/vite.config.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,5 @@ export default mergeConfig(
99
entry: './src/index.ts',
1010
srcDir: './src',
1111
exclude: ['./src/tests/'],
12-
cjs: false,
1312
}),
1413
)

packages/start-server-core/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@
6868
"@tanstack/router-core": "workspace:*",
6969
"@tanstack/start-client-core": "workspace:*",
7070
"@tanstack/start-storage-context": "workspace:*",
71-
"h3": "2.0.0-beta.5",
71+
"h3-v2": "npm:h3@2.0.0-beta.4",
7272
"seroval": "^1.3.2",
7373
"tiny-invariant": "^1.3.3"
7474
},

packages/start-server-core/src/request-response.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import {
1919
unsealSession as h3_unsealSession,
2020
updateSession as h3_updateSession,
2121
useSession as h3_useSession,
22-
} from 'h3'
22+
} from 'h3-v2'
2323
import type {
2424
RequestHeaderMap,
2525
RequestHeaderName,

pnpm-lock.yaml

Lines changed: 11 additions & 23 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)