@nasl/cli 0.1.6 → 0.1.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -97,6 +97,18 @@ nasl dev
97
97
 
98
98
  启动开发服务后,默认可以访问 http://localhost:3100 查看预览效果。
99
99
 
100
+ dev 进程始终保持运行,规则如下:
101
+
102
+ 1. 启动:
103
+ 1. 有 src: 初始编译生成 out,然后启动 webpack
104
+ 2. 无 src:
105
+ 1. 有 out:直接启动 webpack,等待 src 目录创建
106
+ 2. 无 out:启动 webpack,等待 src 目录创建
107
+ 2. 运行中
108
+ 1. out 被删除:如果有 src,自动重新编译恢复 out
109
+ 2. src 被创建:自动编译生成 out 目录
110
+ 3. src 被删除: 使用缓存的 out 目录
111
+
100
112
  ## 开发 CLI 工具
101
113
 
102
114
  ```bash
package/build/index.js CHANGED
@@ -95,7 +95,15 @@ class AppHandler {
95
95
  app.use(window.Cw_chart_js);
96
96
  app.use(window.ElementPlus);
97
97
  window.frontendApp = app;
98
+ console.log("应用 ~ routes:", routes);
98
99
 
100
+ setTimeout(() => {
101
+ if (window.location.pathname === '/notFound') {
102
+ if (routes?.[0]?.path) {
103
+ window.location.replace(routes[0].path);
104
+ }
105
+ }
106
+ }, 100)
99
107
  app.config.globalProperties.$utils.__proto__.isArrayInBounds = function (arr, index, canLast) {
100
108
  return true;
101
109
  }