vue3和trpc混合开发的例子的,可以参考改装,也可以直接clone
下来npm i
使用
dev:vue
启动vue的开发调试dev:node
启动node服务的开发调试build:all
同时打包vue
和node
的项目代码,打包目录分别是build_vue
和build_node
- 改动
vue
的端口
,到vite.config.vue.ts
- 改动
node
的端口
,到vite.config.node.ts
,同时在src/App.vue
里有引用node端口
,也是需要修改. node
的打包由于使用VitePluginNode
插件,导出来是个方法,需要额外调用!- 其实可以声明一份
json
共同读取同个端口
,但是感觉给框架上了很多束缚,那就这样吧~~ - 可能我的做法不是最优解,最重要是玩得开心!!!