我有一个要发布的 typescript 项目,我在名为 build 的目录中生成所有 js 文件,并在名为 declaration 的目录中生成所有声明文件,我不想在发布的版本中包含 .ts 文件 我想知道如何在不使用 gulp 的情况下做到这一点?
这是我的 tsconfig.json
{
"compilerOptions": {
"target": "es6",
"lib": ["es6", "dom"],
"types": ["reflect-metadata"],
"module": "commonjs",
"moduleResolution": "node",
"experimentalDecorators": true,
"emitDecoratorMetadata": true,
"outDir": "build",
"declarationDir": "declaration"
},
"exclude": [
"node_modules"
]
}
和我的 package.json:
{
"name": "data-layer",
"version": "1.1.4",
"description": "data access layer",
"main": "./build/index.js",
"types": "./declaration/index.d.ts",
...
最佳答案
关于typescript - 发布没有 ts 文件的 typescript 包?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40962867/