tms-auth
v1.2.68
Published
<!-- * @Author : [email protected] * @Date : 2025-04-25 11:15:50 * @LastEditors : [email protected] * @LastEditTime : 2025-05-21 15:35:50 * @FilePath : /tms-auth/README.md -->
Downloads
110
Readme
tms-auth
启动项目
安装依赖
$ npm iStart the dev server,
$ npm start或
$ npm run dev本地调试
- 用 npm run dev 启动项目后
- 运行 npm link 或 yarn link
- 在本地的项目 A 中运行 npm link tms-auth 或 yarn link tms-auth 即可调试
注意事项
提示 react 版本升级为 17 问题
用 yarn link 和 yarn link tms-auth
当前项目修改的数据如遇到 link 失败问题
- 可以试试先把
本地的项目A的 node_modules 删掉 - 再执行一下命令 npm link tms-auth --legacy-peer-deps 或 npm link tms-auth --force
若运行后项目 A 提示 css 文件引入问题
方案 1
- 把 @import '~tms-auth/index.css'; 改为 @import '~tms-auth/dist/index.css';
方案 2
临时方案:直接在项目 A 中复制 CSS 文件 ,手动复制 tms-auth 的 CSS 文件到项目 A 中:
- 2.1 复制 node_modules/tms-auth/dist/index.css 到 src/assets/css/
- 2.2 在项目中导入:
@import './assets/css/index.css';
发布到 dev / uat / live 环境
$ npm run pubilsh (dev|uat|live)dev 环境打包后会在 tms-dist-dev uat 环境打包后会在 tms-dist-uat live 环境打包后会在 tms-dist
项目在 package.json 中根据需求引入不同的环境变量,分别是:
"tms-auth": "git+https://bitbucket.org/chatly-biz-tool/tms-auth.git#tms-dist-dev""tms-auth": "git+https://bitbucket.org/chatly-biz-tool/tms-auth.git#tms-dist-uat""tms-auth": "git+https://bitbucket.org/chatly-biz-tool/tms-auth.git#tms-dist"发布失败的原因
1.网络原因:重新发布 2.其他原因:删除 nodemoudles 下的.cache 文件(一般是发布过其他环境后容易出现这个问题)
发布到 npm 包
- 设置源 npm config set registry https://registry.npmjs.org/
- 登录 npm 账号:npm login
- 发布:npm publish
