问题
我正试图在npm中发布我自己的SDK。当我试图安装我的软件包时,我的dist文件夹只显示index.js
代码:
这是我的package.json文件。它已经包括主文件和文件,https://docs.npmjs.com/cli/v8/using-npm/scripts。
{
"version": "0.1.4",
"license": "MIT",
"main": "dist/index.js",
"typings": "dist/index.d.ts",
"files": [
"dist"
],
"engines": {
"node": ">=10"
},
"scripts": {
"start": "tsdx watch",
"build": "tsdx build",
"test": "tsdx test --passWithNoTests",
"lint": "tsdx lint",
"prepare": "tsdx build",
"prepublish": "tsdx build",
"size": "size-limit",
"analyze": "size-limit --why"
},
"peerDependencies": {
"react": ">=16"
},
"husky": {
"hooks": {
"pre-commit": "tsdx lint"
}
},
"name": "@grammable/sdk",
"author": "peanut butter jelly",
"homepage": "https://github.com/grammable/grammable-sdk",
"repository": "https://github.com/grammable/grammable-sdk",
"publishConfig": {
"access": "public"
},
"module": "dist/grammable.esm.js",
"size-limit": [
{
"path": "dist/grammable.cjs.production.min.js",
"limit": "10 KB"
},
{
"path": "dist/grammable.esm.js",
"limit": "10 KB"
}
],
}我删除了我的devDependencies和依赖项以删除不必要的行。有人能帮我吗?
这是我的文件夹结构。文件夹
更新:我尝试过使用npx npm-packlist。它拥有我所需要的一切,但是当我发布它时,它只构建了index.js
编辑2:
npm notice @grammable/sdk@0.1.4
npm notice === Tarball Contents ===
npm notice 35.1kB LICENSE
npm notice 237B README.md
npm notice 184B dist/index.js
npm notice 1.6kB package.json
npm notice === Tarball Details === https://stackoverflow.com/questions/71406870
复制相似问题