I have a project with gigabytes of files. I want to ignore everything except one file. I have tried:
# Ignore everything
*
!api.exe
Which works with .gitignore (https://stackoverflow.com/questions/987142/make-gitignore-ignore-everything-except-a-few-files)
But when I try to deploy I get Error! No files in the deployment
Thanks
Have you tried this without the separate newline in between? It should work just fine.
Also, what's the output of the deployment creation in the terminal? Are you sure it is running on Now 2.0 and not Now 1.0? Because .nowignore is only considered on Now 2.0...
Ok, thanks
I tried having this in my now.json
"builds": [
{
"src": "*.md",
"use": "@now/static"
}
],
And nowignore like:
*
!README.md
It does work, so it seems I'm referencing api.exe in the wrong way above.
For me I wanted to just include the dist/ folder.
Seems you need to re-include it by name without slash (!dist) as well as with slash (!dist/). Only if I add both versions it won't be ignored.
# Ignore everything:
*
# Except for the dist directory
!dist
!dist/
# but don't include the biggest radio file
dist/radio/dcr.mp3
dist/radio/gcr.mp3
Most helpful comment
For me I wanted to just include the
dist/folder.Seems you need to re-include it by name without slash (
!dist) as well as with slash (!dist/). Only if I add both versions it won't be ignored.