上一页 1 2 3 4 5 6 ··· 18 下一页
摘要: 当我们install 项目依赖的时候,会自动生成package-lock.json ❓ 虽然package.json文件有标识依赖的版本号,但是只能固定大版本 看下面的例子 "dependencies": { "@types/node": "^8.0.33", }, 这里面 向上标号^是定义了向后( 阅读全文
posted @ 2022-07-13 09:56 小僵尸 阅读(142) 评论(0) 推荐(0) 编辑
摘要: 1.安装依赖包eslint npm install eslint --save-dev 2.设置package.json文件 "scripts":{ ... "lint":"eslint src", "lint:create":"eslint --init" } 3.初始化eslint npm ru 阅读全文
posted @ 2022-07-12 15:53 小僵尸 阅读(71) 评论(0) 推荐(0) 编辑
摘要: 1、在 src 目录新增 public-path.js: if (window.__POWERED_BY_QIANKUN__) { __webpack_public_path__ = window.__INJECTED_PUBLIC_PATH_BY_QIANKUN__; } 2、入口文件 index 阅读全文
posted @ 2022-07-07 18:33 小僵尸 阅读(1523) 评论(2) 推荐(0) 编辑
摘要: 解决办法 yarn config set ignore-engines true 阅读全文
posted @ 2022-07-06 14:39 小僵尸 阅读(170) 评论(0) 推荐(0) 编辑
摘要: 一、运行单个测试文件 1、cd 到测试文件的目录 2、运行test命令 npm run test -- demo.test.js 二、比较两个值是否相等 toBe比较的是原始值或者对象的引用标识 toEqual比较原始值或者递归比较对象属性的值(Object.is()) 阅读全文
posted @ 2022-07-01 11:15 小僵尸 阅读(198) 评论(0) 推荐(0) 编辑
摘要: 公司两个前端项目,一个需要的node版本为14.4.0 一个用8.17.0 可以使用nvm来对node版本切换 nvm下载地址:https://github.com/coreybutler/nvm-windows/releaseswindow系统推荐下nvm-setup.zip 如果电脑上之前已经安 阅读全文
posted @ 2022-05-09 19:39 小僵尸 阅读(155) 评论(0) 推荐(0) 编辑
摘要: 选择使用的工具 jest 一、安装 npm install --sav-dev jest 二、配置package.json // 修改test文件不会自动执行 npm run test "scripts": { "test": "jest" }, //修改test文件会自动执行 npm run ts 阅读全文
posted @ 2022-05-03 09:34 小僵尸 阅读(155) 评论(0) 推荐(0) 编辑
摘要: 1、create-react-app 4.0.3不再支持全局安装了 2、现在使用npx create-react-app 项目名 项目名不能有大写字母,会报错 阅读全文
posted @ 2022-04-27 11:54 小僵尸 阅读(59) 评论(0) 推荐(0) 编辑
摘要: 将npm 设置为淘宝镜像 npm config set registry https://registry.npmmirror.com 查看npm 的镜像 npm config get registry 阅读全文
posted @ 2022-04-27 11:46 小僵尸 阅读(642) 评论(0) 推荐(0) 编辑
摘要: object ts的object类型 包括函数,数组和对象 如果要单独的约束对象类型,可使用类似字面量的方式 const obj: {foo: number, bar: string} = {foo: 12, bar: 'string'} Array const arr1: Array<number 阅读全文
posted @ 2022-04-06 14:27 小僵尸 阅读(53) 评论(0) 推荐(1) 编辑
上一页 1 2 3 4 5 6 ··· 18 下一页