Why does npm pack wrap in the package folder?

22 Views Asked by At

I have a mini project with this structure

I have a mini project with this structure

my package.json looks like this

{
 "name": "input-date",
 "private": true,
 "version": "0.0.0",
 "main": "./dist/inputDate.umd.cjs",
 "module": "./dist/inputDate.js",
 "type": "module",
 "files": [
   "dist"
 ],
 "exports": {
  ".": {
    "import": "./dist/inputDate.umd.cjs",
    "require": "./dist/inputDate.js"
  }
 },
 "scripts": {
"dev": "vite",
"build": "vue-tsc && vite build && vue-tsc --noEmit",
"preview": "vite preview"
 },
  "dependencies": {
  "devextreme": "23.1.6",
  "devextreme-vue": "23.1.6",
  "vue": "^3.3.11"
 },
 "devDependencies": {
"@vitejs/plugin-vue": "^4.5.2",
"typescript": "^5.2.2",
"vite": "^5.0.8",
"vite-plugin-dts": "^3.7.2",
"@types/luxon": "^3.3.7",
"vue-tsc": "^1.8.25",
"luxon": "^3.4.4"
  }
 }

I build a project using vite, then I do npm pack and I want it to contain only the dist folder, but in the archive this is all indicated in the package folder. How to avoid unnecessary nesting?

0

There are 0 best solutions below