Please allow unignoring files or folders for deployments.
This issue was a pain, especially when Vercel broke my site without warning (how rude!):
See also:
It is totally valid to npm install things, then run a static website that imports files from node_modules using native browser-builtin import. When such a site gets deployed to Vercel, it does not work.
Having a hard-coded ignore rules that cannot be overridden seems unreasonably restrictive.
Hi @trusktr, please share your public repo or a minimal reproducible example. That will let us all work together from the same code to figure out what’s going wrong.
Hi @anshumanb I believe I already described the problem clearly. The problem is that Vercel deletes node_modules before deployment as per above. I do not want Vercel to delete node_modules.
This caused a headache because at some point Vercel was deploying node_modules, but then Vercel decided not to include node_modules in the deployment which broke my app. I then had to come up with a workaround (for example rename node_moduels to module and use that instead, which brought about other issues such as causing the build to sometimes fail for other reasons).
Basically the use case I have is this:
I have a static website
the site is built with vanilla JavaScript modules and importmap (native import syntax for multi-file JavaScript code organization that the browser loads natively)
I install dependencies for the front end with npm install which puts those dependencies in node_modules
My frontend <script type=importmap> defines the import paths for frontend dependencies, for example with mappings like "some-lib": "/node_modules/some-lib/index.js"
This works great locally: the browser, at runtime, will fetch from https://my-site.com/node_modules/some-lib/index.js" when it encounters an import statement like import {something} from 'some-lib' within a JavaScript file.
Now, the problem is, this static website that worked perfectly fine locally (or on other static web hosts besides Vercel such as GitHub Pages or any static web host), and when I deploy to Vercel it does not work because Vercel unconditionally deletes the node_modules folder from the project before deploying the code, therefore the frontend dependencies are all 404 errors at runtime.
The solution to this would be a simple way to unignore the files that Vercel ignores.
@anshumanb Until there’s a solution to this, I would appreciate the ticket not being marked as solved. (however maybe a label is better suited for that purpose, for example something like “feedback acknowledged” or something, as acknowledging feedback has no publicly-visible tracked guarantee on producing any actual solution).
Is the code for this feature accessibly in a public repo? If so, I can try to implement a solution. I would rather not be stuck with a “solved” issue that has no solution.