vercel: "files" key in now.json doesn't override .gitignore
First of all, now is amazing. Seriously. 👏
I’ve seen a number of variations on this issue (including some discussion on Slack), but in my digging I haven’t been able to come up with an answer that makes sense. So please feel free to close if this is a duplicate.
In the now.json docs for the “files” key:
A list of files and directories to be force-uploaded to the deployment (even if they’re ignored by .gitignore).
So in my docker project, I have the following files:
.gitignore
target
now.json
{
"type": "docker",
"files": [
"target"
]
}
I would expect the contents of the target directory to be uploaded. (I also tried the more explicit "./target".) However, the directory is not uploaded unless I remove the relevant entry from .gitignore.
What am I missing?
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Reactions: 7
- Comments: 23 (10 by maintainers)
Commits related to this issue
- Fixed yarn.lock (#717) — committed to vercel/vercel by leo 5 years ago
- Revert "Fixed yarn.lock (#717)" This reverts commit 0c120f6202820e37eb503961ae74bba2f872746d. — committed to vercel/vercel by leo 5 years ago
- Fixed yarn.lock (#717) This reverts commit d83b09ffbdbe7f1affd1ded9b5c9b5a751860f11. — committed to vercel/vercel by leo 5 years ago
- Revert "Fixed yarn.lock (#717)" This reverts commit 5bfbd63e1356da970236f5d0061101ffa685d343. — committed to vercel/vercel by AndyBitz 5 years ago
+1 to deprecate package.json now section. i dont want to publish my now setup to npm/github
@rokf you’re absolutely right. We are bumping the priority of this. Thank you
@Qix that’s a nice proposal.
But I think I’m missing how this solves the original issue.
@mjswensen (and also myself) wants to
filesand.gitignore.As far as I understand you’re proposing to
filesor.gitignore.Do you agree?
I like the idea of having configuration to explicitly include and exclude files.
Hey all, I’ve created a PR that should fix this issue, please comment/discuss #1126
@Qix- It’s been a while since I encountered the problem at first. I don’t remember having a situation which couldn’t be solved with your proposal. +1 for having using
filesas sole authoritative whitelist.I also think I’ve run into this issue.
.gitignore
now.json
distdirectory is not uploaded. In fact onlynow.jsonis uploaded, even though it’s in the root (not indist) and there are other files in the root directory.