vercel: now.files does not allow overriding node_modules ignore
In the Alle monorepo style you follow the following structure:
./packages/node_modules/package1 ./packages/node_modules/package2
The problem is that now does not follow this same behavior and instead of /node_modules being ignored node_modules/**/* is ignored. This behavior differs from npm and means that if you have a directory called node_modules anywhere in your codebase, there is no way to override it. You can try to put exact file paths in now.files but it does not actually override the default node_modules/**/* ignore rule. Instead, if you run now -d you’ll see that now is actually just ignoring the directory as if the rule wasn’t there.
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Reactions: 1
- Comments: 16 (10 by maintainers)
FYI Future people, the solution was to add an
.npmignorewith:Just to add to this
now.filesinsidenow.jsonis not overriding my.gitignoreHere’s the scenario
.gitignore
now.json
Snippet from package.json
nowwill not deploy mydistfolder. If I runserve distlocally it works correctly, am I missing something obvious here? I’ve followed the documentationLooks like that same .npmignore fix works the same for .dockerignore for anyone pulling out their hair over now.json for ignored files when using Docker
Ah, perfect, well that suits my case.
On Tue, 6 Dec 2016, 19:09 Leo Lamprecht, notifications@github.com wrote:
I’d like to chime in on this to may offer another perspective where
filessupport is useful.I have
.envin my project directory. However, to prevent it from going to github, my.gitignorefile is:However, I need it to go up to my new Zeit instance, so I’d expect to have this in my package:
But the
nowclient doesn’t seem to respect that logic, and the.envfile is not included in the deploy.The only work around I have right now, is an inverse rule in my
.npmignore:Having this along side the
.gitignorefile does work, and the.envis deployed to the instance, but it’s pretty confusing (IMHO).Got hit by this while trying to deploy a static version of Speedometer, which relies on assets in
node_modules.It seems like these ignores shouldn’t even apply for static deployments (i.e.
now --static).