Comments (3)
This is a limitation of globs. dist/lib/x.test.js
actually does match dist/**/!(*.test.js)/**
. First part "dist" matches the first part of the glob. Then the second part **
matches zero folders. The third part !(*.test.js)
matches lib
. The last part **
matches x.test.js
.
I think it should work if you do this, though:
{
"files": [
"/dist/",
"!/dist/**/*.test.js"
]
}
The second rule will override the first, and re-ignore those files.
from npm-packlist.
That works for my use case. Thanks!
Could you please clarify why the pattern !dist/**/!(*.test.js)/**
is passed to the ignore-walker
though? Is it necessary? What I specify in the package.json is dist/**/!(*.test.js)
, i.e. without the /**
at the end.
I'm referring to this block in particular - it takes the pattern p
and then converts that to !p
and !p/**
for the ignore-walker
.
Lines 186 to 188 in 270f534
from npm-packlist.
Because at that point it does not know if it's a directory or a file.
This behavior is overly aggressive in what it includes, though, and leads to problems. For example, "files": ["lib"]
will include lib/.DS_Store
, which you never want.
That'll be fixed in v2.
from npm-packlist.
Related Issues (20)
- [BUG] `bundledDependencies` does not work in NPM workspaces subpackage HOT 1
- [BUG] workspace root `.gitignore` supersed every `.npmignore` and `.gitignore` HOT 13
- [BUG/QUESTION] since npm 9.x some files[] globs undermatch HOT 4
- [BUG] npx npm-packlist broken HOT 3
- Reporting a vulnerability HOT 1
- [BUG] Package tarballs are included by default HOT 1
- [BUG] packed files list includes `node_modules` files HOT 4
- [BUG] Behavior change for glob like foo/**/* in 8.0.1 relative to 8.0.0. HOT 4
- [Question] `arborist.loadActual()` can be used with `ignoreMissing` ?
- [BUG] v2 does not include bundleDependencies if has files HOT 2
- [BUG] npm-normalize-package-bin is not in package.json HOT 3
- [FEATURE] Expand the list of default ignored files HOT 3
- don't include .git folder in bundled deps
- [BUG] npm-shrinkwrap.json should not be published if referenced in .npmignore HOT 4
- [BUG] `npm pack` should not attempt to include unix socket files
- [BUG] node_modules always ignored even if specified in package.json's files entry HOT 2
- [FEATURE] auto add files from exports map HOT 1
- [BUG] Can't get it to ignore README.md HOT 1
- [BUG] Missing CHANGELOG HOT 2
- [BUG] Docs still say CHANGELOG will be included in the packlist by default HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from npm-packlist.