# umi-example **Repository Path**: aomd-example/umi-example ## Basic Information - **Project Name**: umi-example - **Description**: umi 例子....... - **Primary Language**: TypeScript - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2023-07-14 - **Last Updated**: 2024-07-18 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # 此项目仅供 ## 3.x 输出结果 ``` sh # npm run start # browser console start uuid undefined ``` ``` sh # npm run build # browser console start uuid undefined ``` ***一言难尽*** 3.x 通过源码 `export { Helmet } from '{path}/umi-example/3.x/node_modules/react-helmet'`可以看到使用的是 `react-helmet` 会导致 [Helmet SSR 没有插入 script 标签的能力](https://github.com/umijs/umi/issues/7648) 通过 `build` 之后代码可以看到 `title` `meta` `link` 在开启 `ssr` 后均有插入,唯独缺少了 `script` ## 3.x-modified 输出结果 (期望结果) ``` sh # npm run start # browser console start uuid {NIL: '00000000-0000-0000-0000-000000000000', parse: ƒ, stringify: ƒ, v1: ƒ, v3: ƒ, …} ``` ``` sh # npm run build # browser console start uuid {NIL: '00000000-0000-0000-0000-000000000000', parse: ƒ, stringify: ƒ, v1: ƒ, v3: ƒ, …} ``` ***非常完美 (๑•̀ㅂ•́)و✧*** 之前还得自己手动补丁才行 这里得感谢下 [@limi58](https://github.com/limi58) ### 差异 ```json // package.json { "devDependencies": { // -- @umijs/preset-react // ++ @umijs/plugin-helmet } } ``` ## 4.x 输出结果 ``` sh # npm run start # browser console uuid undefined start ``` ``` sh # npm run build # browser console start uuid {NIL: '00000000-0000-0000-0000-000000000000', parse: ƒ, stringify: ƒ, v1: ƒ, v3: ƒ, …} ``` ***dev 连执行顺序都错乱了... 光秃秃的啥标签都没加上*** ***build 没有连执行顺序问题*** ## 希望4.x dev 也能做到和 build 一样的执行逻辑