注意事项:1.此项目没有路由,2.没有 API请求
 环境配置 请看文档
 tauri 文档
 第一步:在需要打包的项目根目录执行命令
npm install --save-dev @tauri-apps/cli
第二步:在 package.json scripts 中添加 tauri
"scripts": {
    "start": "react-scripts start",
    "build": "react-scripts build",
    "test": "react-scripts test",
    "eject": "react-scripts eject",
    "tauri": "tauri" //添加此代码
  },
第三步:在项目根目录 初始化 tauri ,一直回车就行,需要修改参数就在配置文件修改即可。
npm run tauri init
初始化完成 会出现一个 src-tauri的文件夹。
 第四步: 启动项目执行命令
npm run tauri dev
注意事项:
 1)如果出现如下错误
npm ERR! Missing script: "dev"
npm ERR!
npm ERR! To see a list of scripts, run:
npm ERR!   npm run
npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\14991\AppData\Local\npm-cache\_logs\2023-02-18T02_04_03_466Z-debug-0.log
       Error The "beforeDevCommand" terminated with a non-zero status code.
原因是 在 tauri.conf.json 配置文件中 beforeDevCommand 参数 的 值错误,应该是React 项目 package.json 里的 项目启动命令。
 例:我的是 “npm run start ”
 "scripts": {
    "start": "react-scripts start", //我的启动命令
    "build": "react-scripts build",
    "test": "react-scripts test",
    "eject": "react-scripts eject",
    "tauri": "tauri"
  },
//修改后的 tauri.conf.json
"build": {
    "beforeBuildCommand": "npm run build",
    "beforeDevCommand": "npm run start", //修改后的值
    "devPath": "http://localhost:3000",
    "distDir": "../build"
  },
beforeBuildCommand 同理 记得修改
 重新执行 npm run tauri dev (会下载一些包不要急,时间会挺长)
 结果会出现一个窗口 成功
 
 第四步打包:执行命令
npm run tauri build
报错
 Error You must change the bundle identifier in `tauri.conf.json > tauri > bundle > identifier`. The default value `com.tauri.dev` is not allowed as it must be unique across applications.
 解决 修改 tauri.conf.json 在文件中的 identifier参数,修改为非默认值。
 
重新执行命令(等待打包)
 完成打包
 

![[数据结构]---八大经典排序算法详解](https://img-blog.csdnimg.cn/0e8142407d4d4211b8615f4750ab6a65.png#pic_center)

![SpringCloud系列(十三)[分布式搜索引擎篇] - ElasticSearch 的概念及 Centos 7 下详细安装步骤](https://img-blog.csdnimg.cn/d5befcf1c15f489d8d23b861827c13c5.png#pic_center)














![Reverse入门[不断记录]](https://img-blog.csdnimg.cn/4f5350c563364eac9cdf63440df5b863.png)
