Giter Club home page Giter Club logo

Comments (13)

mrjoelkemp avatar mrjoelkemp commented on May 18, 2024

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.

SimenB avatar SimenB commented on May 18, 2024

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.

SimenB avatar SimenB commented on May 18, 2024

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.

mrjoelkemp avatar mrjoelkemp commented on May 18, 2024

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.

SimenB avatar SimenB commented on May 18, 2024

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.

mrjoelkemp avatar mrjoelkemp commented on May 18, 2024

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.

SimenB avatar SimenB commented on May 18, 2024

@mrjoelkemp See dependents/node-filing-cabinet#5

from node-dependency-tree.

mrjoelkemp avatar mrjoelkemp commented on May 18, 2024

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.

mrjoelkemp avatar mrjoelkemp commented on May 18, 2024

@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.

SimenB avatar SimenB commented on May 18, 2024

It does work now, thanks!

from node-dependency-tree.

SimenB avatar SimenB commented on May 18, 2024

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.

mrjoelkemp avatar mrjoelkemp commented on May 18, 2024

@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.

SimenB avatar SimenB commented on May 18, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.