diff --git a/.gitignore b/.gitignore index ebb3dd5..8f5fbfa 100644 --- a/.gitignore +++ b/.gitignore @@ -28,4 +28,4 @@ yarn-debug.log* yarn-error.log* /.idea -webstorm.config.js* +#webstorm.config.js* diff --git a/README.md b/README.md index 7445862..96a18ad 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ ## 1、项目结构 ``` -├── electron-basic # 桌面应用 +├── electron-react # 桌面应用 ├── build # web包编译后资源目录 ├── extraResources # 视窗额外打包文件(比如各种执行的cmd/py脚本) ├── public # web包编译前资源目录 @@ -45,11 +45,12 @@ 开发环境 npm run start -生产环境 +编译生产环境 npm run build -启动测试环境: npm run start:web -启动开发环境: npm run start 可以进行调试 +编译测试or仿真环境 +npm run build:test + ``` diff --git a/package.json b/package.json index f64026b..469dabd 100644 --- a/package.json +++ b/package.json @@ -31,6 +31,7 @@ "test": "electron . test", "build:test:web": "env-cmd -f .env.test craco build", "build:web": "cross-env REACT_APP_ENVIRONMENT=production craco build --win", + "build:test": "rimraf build && env-cmd -f .env.test craco build && rimraf release && electron-builder", "build": "rimraf build && npm run build:web && rimraf release && electron-builder", "build:deb": "electron-builder --linux deb tar.xz", "build:deb:arm64": "electron-builder --linux deb --arm64", diff --git a/webstorm.config.js b/webstorm.config.js new file mode 100644 index 0000000..b89a466 --- /dev/null +++ b/webstorm.config.js @@ -0,0 +1,25 @@ +/** + * @author Kevin + * @Date: 2024-4-10 + */ +'use strict' +const path = require('path') + +module.exports = { + context: path.resolve(__dirname, './'), + resolve: { + extensions: ['.js', '.vue', '.json'], + alias: { + '@': path.resolve('src'), + '@statics': path.resolve(__dirname, 'src/statics'), + '@views': path.resolve(__dirname, 'src/views'), + '@comp': path.resolve(__dirname, 'src/components'), + '@services': path.resolve(__dirname, 'src/services'), + '@api': path.resolve(__dirname, 'src/api'), + '@utils': path.resolve(__dirname, 'src/utils'), + '@redux': path.resolve(__dirname, 'src/redux'), + '@styles': path.resolve(__dirname, 'src/styles'), + '@configs': path.resolve(__dirname, 'src/configs'), + } + } +}