Giter VIP home page Giter VIP logo

Comments (13)

indexzero avatar indexzero commented on April 28, 2024

@isaacs Do you know how to ignore only some of the folders in the node_modules folder?

from http-server.

isaacs avatar isaacs commented on April 28, 2024

Not sure what you mean. You want to bundle your deps? Use the bundleDependencies list in package.json. Check out how npm does it with its own internal dependencies.

from http-server.

indexzero avatar indexzero commented on April 28, 2024

@isaacs This is a git issue. For example in most of my projects I put the following in the git ignore:

npm-debug.log
node_modules

I could update the git ignore to only explicitly ignore those modules in the package.json and vendor the others, but I was hoping there might be a less verbose option

from http-server.

isaacs avatar isaacs commented on April 28, 2024

Why not just remove that .gitignore, and vendor in node_modules?

rm -rf node_modules #clean start
npm install
find node_modules -name .gitignore | xargs rm
git add node_modules
git rm -rf vendor
echo npm-debug.log > .gitignore
git add .gitignore
git ci -m "vendor in node_modules ftw"

from http-server.

Marak avatar Marak commented on April 28, 2024

@isaacs - I seem to have memories of getting fail when attempting to vendor things in the node_modules folder.

Knowing that vendoring into node_modules is a good idea, I will experiment again.

from http-server.

dominictarr avatar dominictarr commented on April 28, 2024

the point is also to not save everything you have installed with npm in git.

what if node also treated a second folder (i.e. vendor) just like node_modules?

@indexzero I think you can have a line like !node_modules/foo in the .gitignore and it will not ignore it.

from http-server.

isaacs avatar isaacs commented on April 28, 2024

Or, you could just install all your deps with npm, list them in your
package.json file as dependencies, keep ignoring node_modules in git,
and add all your dependencies to the bundleDependencies list. npm help json

On Thu, Aug 11, 2011 at 16:38, dominictarr
[email protected]
wrote:

the point is also to not save everything you have installed with npm in git.

what if node also treated a second folder (i.e. vendor) just like node_modules?

@indexzero I think you can have a line like !node_modules/foo in the .gitignore and it will not ignore it.

Reply to this email directly or view it on GitHub:
https://github.com/nodejitsu/http-server/issues/3#issuecomment-1787028

from http-server.

Marak avatar Marak commented on April 28, 2024

@isaacs - So like, the reason that static is vendored is because it's from a custom fork we made which doesn't have a github repo or npm package.

from http-server.

isaacs avatar isaacs commented on April 28, 2024

Ok. You can still give it a package.json and put it in node_modules and bundle it. or you can do require("./vendor/static") to include it.

Modifying require.paths is a bad idea. It's brittle, makes your programs less intelligible to newcomers, and will throw in node 0.5 and higher.

from http-server.

jfhbrook avatar jfhbrook commented on April 28, 2024

So like, the reason that static is vendored is because it's from a custom fork we made which doesn't have a github repo or npm package.

Why is this so? Is this something we can change?

from http-server.

dominictarr avatar dominictarr commented on April 28, 2024

fixed is nodejitsu@1c5e147

@jesusabdullah, basically the problem that that cloudhead is not maintaining his projects.

from http-server.

isaacs avatar isaacs commented on April 28, 2024

@dominictarr Awesome! Welcome to future of node!

from http-server.

dominictarr avatar dominictarr commented on April 28, 2024

cheers!
for future reference, the most difficult change is

#.gitignore
node_modules

to

#.gitignore
node_modules/*
!node_modules/$BUNDLED_DEP 

! means to not ignore this line.
see git help ignore

from http-server.

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.