feat: overlay
This commit is contained in:
parent
7877259057
commit
90b9a17fd0
39
.vscode/tasks.json
vendored
39
.vscode/tasks.json
vendored
|
@ -15,7 +15,7 @@
|
|||
"dicom",
|
||||
"dmp-gateway",
|
||||
"aorta-gateway",
|
||||
"cert-gateway",
|
||||
"cert-gateway"
|
||||
]
|
||||
},
|
||||
{
|
||||
|
@ -32,19 +32,20 @@
|
|||
"type": "shell",
|
||||
"command": "pnpm",
|
||||
"args": [
|
||||
"dev:logger",
|
||||
],
|
||||
"dev:logger"
|
||||
]
|
||||
},
|
||||
{
|
||||
"label": "aorta-web",
|
||||
"type": "shell",
|
||||
"command": "pnpm",
|
||||
"args": [
|
||||
"dev:aorta-web",
|
||||
"dev:aorta-web"
|
||||
],
|
||||
"dependsOn": [
|
||||
"build:pkg"
|
||||
]
|
||||
],
|
||||
"problemMatcher": []
|
||||
},
|
||||
{
|
||||
"label": "cert-web",
|
||||
|
@ -62,7 +63,7 @@
|
|||
"type": "shell",
|
||||
"command": "pnpm",
|
||||
"args": [
|
||||
"dev:dmp-web",
|
||||
"dev:dmp-web"
|
||||
],
|
||||
"dependsOn": [
|
||||
"build:pkg"
|
||||
|
@ -73,27 +74,27 @@
|
|||
"type": "shell",
|
||||
"command": "pnpm",
|
||||
"args": [
|
||||
"dev:dmp-archive",
|
||||
"dev:dmp-archive"
|
||||
],
|
||||
"dependsOrder": "sequence",
|
||||
"dependsOrder": "sequence"
|
||||
},
|
||||
{
|
||||
"label": "dicom",
|
||||
"type": "shell",
|
||||
"command": "pnpm",
|
||||
"args": [
|
||||
"dev:dicom",
|
||||
"dev:dicom"
|
||||
],
|
||||
"dependsOrder": "sequence",
|
||||
"dependsOrder": "sequence"
|
||||
},
|
||||
{
|
||||
"label": "cert-authorize",
|
||||
"type": "shell",
|
||||
"command": "pnpm",
|
||||
"args": [
|
||||
"dev:authorize",
|
||||
"dev:authorize"
|
||||
],
|
||||
"dependsOrder": "sequence",
|
||||
"dependsOrder": "sequence"
|
||||
},
|
||||
{
|
||||
"label": "cert-authenticate",
|
||||
|
@ -102,7 +103,7 @@
|
|||
"args": [
|
||||
"dev:authenticate"
|
||||
],
|
||||
"dependsOrder": "sequence",
|
||||
"dependsOrder": "sequence"
|
||||
},
|
||||
{
|
||||
"label": "cert-gateway",
|
||||
|
@ -111,25 +112,25 @@
|
|||
"args": [
|
||||
"dev:cert-gateway"
|
||||
],
|
||||
"dependsOrder": "sequence",
|
||||
"dependsOrder": "sequence"
|
||||
},
|
||||
{
|
||||
"label": "dmp-gateway",
|
||||
"type": "shell",
|
||||
"command": "pnpm",
|
||||
"args": [
|
||||
"dev:dmp-gateway",
|
||||
"dev:dmp-gateway"
|
||||
],
|
||||
"dependsOrder": "sequence",
|
||||
"dependsOrder": "sequence"
|
||||
},
|
||||
{
|
||||
"label": "aorta-gateway",
|
||||
"type": "shell",
|
||||
"command": "pnpm",
|
||||
"args": [
|
||||
"dev:aorta-gateway",
|
||||
"dev:aorta-gateway"
|
||||
],
|
||||
"dependsOrder": "sequence",
|
||||
},
|
||||
"dependsOrder": "sequence"
|
||||
}
|
||||
]
|
||||
}
|
|
@ -35,7 +35,8 @@
|
|||
"@babel/preset-env": "^7.21.5",
|
||||
"@babel/preset-react": "^7.18.6",
|
||||
"@babel/preset-typescript": "^7.21.5",
|
||||
"@pmmmwh/react-refresh-webpack-plugin": "^0.5.10",
|
||||
"@pmmmwh/react-refresh-webpack-plugin": "0.5.10",
|
||||
"react-refresh": "0.14.0",
|
||||
"@types/node": "18.16.3",
|
||||
"@types/react": "^18.0.28",
|
||||
"@types/react-dom": "^18.0.11",
|
||||
|
@ -57,7 +58,6 @@
|
|||
"mini-css-extract-plugin": "^2.7.5",
|
||||
"prettier": "^2.8.8",
|
||||
"purgecss-webpack-plugin": "^5.0.0",
|
||||
"react-refresh": "^0.14.0",
|
||||
"speed-measure-webpack-plugin": "^1.5.0",
|
||||
"style-loader": "^3.3.2",
|
||||
"terser-webpack-plugin": "^5.3.7",
|
||||
|
|
|
@ -7,14 +7,14 @@ import baseConfig from "./webpack.common";
|
|||
import ReactRefreshWebpackPlugin from "@pmmmwh/react-refresh-webpack-plugin";
|
||||
const FriendlyErrorsWebpackPlugin = require("friendly-errors-webpack-plugin");
|
||||
import { proxyMap } from "./dev.proxy";
|
||||
|
||||
/**
|
||||
* 运行命令的时候重启一次打开一个tab 页很烦,所以呢优化一下
|
||||
* 参考:create-react-app 的启动方式
|
||||
* https://github.com/facebook/create-react-app/blob/main/packages/react-dev-utils/openChrome.applescript
|
||||
* 记得关闭webpack-dev-server的配置中的自动打开 open: false 或者注释
|
||||
*/
|
||||
const openBrowser = require("./util/openBrowser");
|
||||
|
||||
// import openBrowser from "./util/openBrowser";
|
||||
|
||||
interface Configuration extends WebpackConfiguration {
|
||||
devServer?: WebpackDevServerConfiguration;
|
||||
|
@ -35,7 +35,7 @@ const devConfig: Configuration = merge(baseConfig, {
|
|||
devtool: "eval-cheap-module-source-map",
|
||||
stats: "errors-only",
|
||||
plugins: [
|
||||
new ReactRefreshWebpackPlugin(), // 添加热更新插件
|
||||
new ReactRefreshWebpackPlugin({ overlay: false }), // 添加热更新插件
|
||||
new FriendlyErrorsWebpackPlugin(),
|
||||
],
|
||||
});
|
||||
|
@ -54,13 +54,16 @@ const devServer = new WebpackDevServer(
|
|||
},
|
||||
headers: { "Access-Control-Allow-Origin": "*" },
|
||||
proxy: proxyMap,
|
||||
client: {
|
||||
progress: true,
|
||||
},
|
||||
},
|
||||
webpack(devConfig)
|
||||
);
|
||||
|
||||
devServer.start().then(() => {
|
||||
// 启动界面
|
||||
openBrowser(`http://${host}:${port}`);
|
||||
// openBrowser(`http://${host}:${port}`);
|
||||
});
|
||||
|
||||
export default devConfig;
|
||||
|
|
|
@ -91,7 +91,7 @@ importers:
|
|||
specifier: ^7.21.5
|
||||
version: 7.21.5(@babel/core@7.21.8)
|
||||
'@pmmmwh/react-refresh-webpack-plugin':
|
||||
specifier: ^0.5.10
|
||||
specifier: 0.5.10
|
||||
version: 0.5.10(react-refresh@0.14.0)(webpack-dev-server@4.13.3)(webpack@5.75.0)
|
||||
'@types/js-cookie':
|
||||
specifier: 3.0.3
|
||||
|
@ -163,7 +163,7 @@ importers:
|
|||
specifier: ^5.0.0
|
||||
version: 5.0.0(webpack@5.75.0)
|
||||
react-refresh:
|
||||
specifier: ^0.14.0
|
||||
specifier: 0.14.0
|
||||
version: 0.14.0
|
||||
speed-measure-webpack-plugin:
|
||||
specifier: ^1.5.0
|
||||
|
|
Loading…
Reference in New Issue
Block a user