and
version:
antdv :3.2.20环境版本:
$ node -v
v20.9.0
$ npm -v
10.1.0
制作过程:
- github下载压缩包
.xcode 的下拉中 downloadzip
2.删除pnpm-lock.yaml后安装依赖
2. 解压后修改package.json
- 由于本机直接运行npm run site 会报 “.” is not xxx
- 如果不修改能直接运行则直接运行site 命令
修改前
"site": "npm run routes && ./node_modules/vite/bin/vite.js build site --base=/",
修改后
"site2": "vite build site --base=/",
- 在site 目录下生成的dist 拷贝到nginx 的html 中
- 修改nginx 配置文件 如下
- try_files $uri $uri/ /index.html; —解决刷新页面路由丢失问题
server {listen 8004;location / {try_files $uri $uri/ /index.html;root html/dist;index index.html index.htm;}}
- 启动nginx.exe 后访问 http://localhost:8004
- 点击english 切换语言 即可
备注:
如果语言切换不生效可修改源代码的src 中i18n.js 后重新打包
附件
发布者:admin,转转请注明出处:http://www.yc00.com/web/1701606012a1128445.html
评论列表(0条)