me

发布 npm


字段

发布 javascript 版本的包

npm publish [<tarball>|<folder>] [--tag <tag>] [--access <public|restricted>] [--otp otpcode] [--dry-run]

Publishes '.' if no argument supplied
Sets tag 'latest' if no --tag specified

发布一个公共的包,不包含私有作用域

打包 typescript 版本的包

一些 typescript 中特有的配置

配置 tsconfig.json

{
  "compilerOptions": {
    "target": "es2016",
    "module": "CommonJS",
    "rootDir": "./src",
    "declaration": true,
    "sourceMap": true,
    "outDir": "./dist",
    "esModuleInterop": true,
    "forceConsistentCasingInFileNames": true,
    "strict": true,
    "skipLibCheck": true
  }
}
"main": "dist/index.js",
"types": "dist/index.d.ts"