npm 地址 https://github.com/waillyer/tcplayer-ui.git
tsconfig.build.json
{
"compilerOptions": {
"outDir": "dist", // 生成目录
"module": "esnext", // 格式
"target": "es5", // 版本
"declaration": true, // 为每一个 ts 文件生成 .d.ts 文件
"jsx": "react",
"moduleResolution": "Node", // 规定寻找引入文件的路径为 node 标准
"allowSyntheticDefaultImports": true
},
"include": [
// 要编译哪些文件
"src"
],
"exclude": [
// 排除不需要编译的文件
"src/**/*.test.tsx",
"src/**/*.stories.tsx",
"src/setupTests.ts"
]
}
package.json 修改
"name": "tcplayer-ui",
"version": "0.1.1",
"private": false,
"clean": "rimraf ./dist",
"build": "npm run clean && npm run build-ts && npm run build-css",
先切换官方镜像源。
npm config set registry registry.npmjs.org/
npm whoami