Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

jitsu package create packs nested node_modules #454

Open
assembler opened this issue Jul 21, 2013 · 3 comments
Open

jitsu package create packs nested node_modules #454

assembler opened this issue Jul 21, 2013 · 3 comments

Comments

@assembler
Copy link

When I try this:

jitsu package create

It packs "/frontend/node_modules" folder even though it is excluded within .gitignore. This makes deploys rather large.. How can i fix this?

@assembler
Copy link
Author

I tried with .npmignore and even .jitsuignore.. didn't help.

@mmalecki
Copy link
Contributor

@assembler only node_modules in the package root is excluded by default. What's your usecase?

Also, the following worked for me:

[maciej@pc09 454]$ mkdir -p frontend/node_modules
[maciej@pc09 454]$ touch frontend/node_modules/.keep
[maciej@pc09 454]$ echo 'frontend/node_modules' > .gitignore
[maciej@pc09 454]$ mkdir node_modules
[maciej@pc09 454]$ touch node_modules/.keep
[maciej@pc09 454]$ echo 'node_modules' > .gitignore
[maciej@pc09 454]$ vim package.json
[maciej@pc09 454]$ jitsu snapshots create
info:    Welcome to Nodejitsu mmalecki
info:    jitsu v0.12.14, node v0.11.3
info:    It worked if it ends with Nodejitsu ok
warn:    You are using unstable version of node.js. You may experience problems.
info:    Executing command snapshots create
info:    Analyzing application dependencies in node server.js
info:    Creating snapshot 0.0.0-17
info     Uploading: [=============================] 100%
info:    Nodejitsu ok
[maciej@pc09 454]$ tar xvf ~/.jitsu/tmp/mmalecki-test-node-gd-0.0.0-17.tgz
x package/package.json
x package/.npmignore

As you can see, neither of node_modules or frontend/node_modules is included.

@assembler
Copy link
Author

I found that the problem is that under frontend i have also the "package.json" file which describes the frontend application. If i remove that file, all works fine, but can't get it to work with it.

The use case is as follows:

A) i have main nodejs application which serves two purposes:

  1. RESTful API
  2. serving static assets (index.html, app.js, app.css and images)

B) I have nested frontend application which is done in angularjs. Grunt is used for building into frontend/dist folder, and build dependencies are listed in frontend/package.json file. It also uses bower for managing frontend dependencies.

I want to create optimal jitsu package (without frontend/node_modules which is huge), push it to nodejitsu and then compile the frontend there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants