Comments (13)
Thanks for reporting. I don't recall having any optimizations in place for that dependency. Do you know what would fix this issue?
from node-dependency-tree.
Well, yargs-parser
depends on /home/testyo/repos/frontend-repo/code/node_modules/yargs-parser/node_modules/lodash.assign
not on /home/testyo/repos/frontend-repo/code/node_modules/lodash.assign
like it currently resolves to.
Where is the resolution logic, maybe I could take a look?
from node-dependency-tree.
Maybe use https://github.com/substack/node-resolve which allows us to set a basedir? If you currently use require.resovle
it might work
from node-dependency-tree.
The dependency-tree module doesn't use lodash.assign directly. I can't find its usage in any of the dependencies either.
Does your shrinkwrap fail? Or is it that the deduping isn't as good as it could be?
Also, how did you gather that dependency-tree is involved?
from node-dependency-tree.
Yeah, that's it. Digging down into filing-cabinet
, require.resolve
is used, ignoring where the require comes from. So nested dependencies will never resolve correctly
from node-dependency-tree.
I'm open to using node-resolve instead if that'll fix the issue. Sadly, passing along a baseDir will involve having both dependency-tree
and filing-cabinet
support the option. I'm happy to review PRs for whatever is necessary, but I don't have the availability to fix this issue myself.
Is there an easy workaround?
from node-dependency-tree.
@mrjoelkemp See dependents/node-filing-cabinet#5
from node-dependency-tree.
Try npm update dependency-tree
to get the recent patch release for filing-cabinet and let me know if that works for you.
from node-dependency-tree.
@SimenB may I ask, what are you using dependency-tree for? Curious as to its applications outside of the stuff I've written.
from node-dependency-tree.
It does work now, thanks!
from node-dependency-tree.
To answer your question, we currently have a mock version of our Spring app running on express, which is used for front end development. But the same version is also bundled up for usage as a demo from a memory stick. When we bundle it, we want to avoid adding development dependencies to the tar ball, so we use dependency-tree to get only the actual dependencies and zipping it up in one file.
from node-dependency-tree.
@SimenB that sounds pretty cool. Might be interesting to have http://rollupjs.org/ use dependency-tree to support commonjs and amd apps.
from node-dependency-tree.
We tried webpacking it, but native dependencies messed up when in a single file (logically, I suppose). But dependency-tree works good for us, just using archiver to add the deps we get, just deduping them and messing with the strings to get relative pathing, to a zip.
from node-dependency-tree.
Related Issues (20)
- Unable to resolve directory dependencies HOT 4
- -
- how to support vue file? HOT 4
- npm i --global-style
- dynamic import with Typescript doesn't work. HOT 10
- Exclude unused import HOT 3
- Sass imports from node_modules HOT 1
- fix(tsconfig): path mapping (module alias)
- Out of memory without `--list-form` HOT 1
- Find dependents
- Why not supporting an object for webpackConfig parameter? HOT 1
- Don't support alias in webpack.config.js
- Node package.json exports field not understood.
- feat: list import identifiers in dep tree HOT 3
- Why is precinctOptions.includeCore always false?
- dependencyTree only returning an empty object HOT 2
- Help fix
- Miss typings definine in package.json `files` HOT 1
- Resolving local/nested node_modules folder
- Fix tests on Node.js 20 HOT 5
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 node-dependency-tree.