admin 管理员组文章数量: 1086019
I would like to update the port that my app is running on but the TanStack Start [defineConfig][1]
method doesn't seem to expose that like a normal Vite config does. Here is my app.config.ts
:
import { defineConfig } from "@tanstack/react-start/config";
import tsConfigPaths from "vite-tsconfig-paths";
import tailwindcss from "@tailwindcss/vite";
export default defineConfig({
tsr: {
appDirectory: "src",
},
server: {
preset: "vercel",
},
vite: {
plugins: [
tailwindcss(),
tsConfigPaths({
projects: ["./tsconfig.json"],
}),
],
build: {
rollupOptions: {
external: ["./storage/**"], // Mark all subdirectories under storage as external
},
},
},
});
Currently it always runs on port 3000. How do I set this up?
I would like to update the port that my app is running on but the TanStack Start [defineConfig][1]
method doesn't seem to expose that like a normal Vite config does. Here is my app.config.ts
:
import { defineConfig } from "@tanstack/react-start/config";
import tsConfigPaths from "vite-tsconfig-paths";
import tailwindcss from "@tailwindcss/vite";
export default defineConfig({
tsr: {
appDirectory: "src",
},
server: {
preset: "vercel",
},
vite: {
plugins: [
tailwindcss(),
tsConfigPaths({
projects: ["./tsconfig.json"],
}),
],
build: {
rollupOptions: {
external: ["./storage/**"], // Mark all subdirectories under storage as external
},
},
},
});
Currently it always runs on port 3000. How do I set this up?
Share Improve this question asked Mar 29 at 22:40 Code on the RocksCode on the Rocks 18k6 gold badges74 silver badges94 bronze badges1 Answer
Reset to default 0Since the current version of TanStack Start uses Vinxi under the hood, you can update your package.json
scripts to pass in the port like this:
"scripts": {
"dev": "vinxi dev --port 3008",
"build": "vinxi build",
"start": "vinxi start"
},
Or just the CLI command:
vinxi dev --port 3008
本文标签: How do you change the port for a TanStack Start appStack Overflow
版权声明:本文标题:How do you change the port for a TanStack Start app? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.roclinux.cn/p/1744001958a2516609.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论