I am facing an issue while trying to create a npm package, as the result differs from what is displayed in the console.
This is a test library built with Vite and VueJS.
Within my project structure, I have folders named .github
, node_modules
, and src
, all residing in the same directory as the package.json
file. When I execute npm run build
, it generates a dist
folder in the root directory that contains the expected .js
files.
The problem arises when: Despite excluding the dist
directory from GitHub repository using .gitignore
, the published package does not include the dist
folder during npm publish
.
I attempted creating a .npmignore
file mirroring the .gitignore
but excluding the dist
entry. Additionally, my package.json
includes dist
within the files
array.
The output of the GitHub action seems correct:
npm notice 413B dist/components/icons/vue-theme.es17.js
...
npm notice total files: 46
npm notice
npm notice Publishing to https://npm.pkg.github.com with tag latest and default access
+ @mickedplay/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="d0a6a5b5fda4b8b5bdb590e0fee0fee5e4">[email protected]</a>
However, upon installing the package in another project using
"@mickedplay/vue-theme": "github:mickedplay/vue-theme"
, the node_modules
directory only contains README.md
and package.json
, without the dist
folder.
You can view the test repository publicly at: https://github.com/mickedplay/vue-theme
In conclusion, the NPM package fails to incorporate the dist
directory despite specified inclusion. What could be missing? Have I overlooked something?
Thank you.