node_modules on server?

881 views
Skip to first unread message

Daveyon Mayne

unread,
Jul 31, 2015, 3:24:12 AM7/31/15
to Firebase Google Group
My polymer app is structured like this:

APP-NAME/
.git/
app/
node_modules/
firebase/
sendgrid/
<many-more>/ 
package.json
gulpfile.js

 
I have to deploy the contents off the app folder to firebase and I need the files from node_modules. How can I deploy the node_module modules folder? I need sendgrid and others.

Thanks
 
 
 
 

Kato Richardson

unread,
Jul 31, 2015, 11:20:15 AM7/31/15
to fireba...@googlegroups.com
Daveyon,

I know nothing about Polymer and this could be a special case. If so, forgive my ignorance here; it's something I'm hoping to get up to speed on soon.

Generally speaking, we recommend using the CDN version. But if you want to go with deployed/JavaScript files, I'd recommend bower install, since it is more focused on JavaScript/browsers than node.js usage. Keep in mind that if you deploy the firebase node module, you'll need to point your scripts to firebase-web.js and not firebase-node.js.

Having said this, you'll need the node_modules to be in your app/ folder if you want it to be picked up by firebase deploy. How to move it has been discussed before, so I'll skip that here.

☃, Kato

--
You received this message because you are subscribed to the Google Groups "Firebase Google Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to firebase-tal...@googlegroups.com.
To post to this group, send email to fireba...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/firebase-talk/b8c7bb2e-1eee-45b4-855a-e88a3d5f1de7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Jacob Wenger

unread,
Jul 31, 2015, 11:45:23 AM7/31/15
to fireba...@googlegroups.com
Hey Daveyon,

In case you just want to use Firebase Hosting and deploy your local /node_modules/ directory, you will need to update the ignore rule in your firebase.json. By default, it looks like this:

"ignore": [
  "firebase.json",
  "**/.*",
  "**/node_modules/**"
]

You'll want it to look like this instead:

"ignore": [
  "firebase.json",
  "**/.*"
]

Hope that helps,
Jacob


Daveyon Mayne

unread,
Jul 31, 2015, 11:47:10 AM7/31/15
to fireba...@googlegroups.com

Thanks. I'll have a read through.

You received this message because you are subscribed to a topic in the Google Groups "Firebase Google Group" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/firebase-talk/qgl_oL80kKQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to firebase-tal...@googlegroups.com.

To post to this group, send email to fireba...@googlegroups.com.

Daveyon Mayne

unread,
Aug 30, 2015, 7:41:46 AM8/30/15
to Firebase Google Group
Hi Kato

Could you explain what you meant by `you'll need to point your scripts to firebase-web.js and not firebase-node.js`?

Michael Lehenbauer

unread,
Aug 31, 2015, 12:24:04 PM8/31/15
to Firebase Google Group
Hey Daveyon,

I can explain what Kato's referring to, but it may or may not be relevant to your situation depending on what exactly you're doing.

The "firebase" module on npm contains two different scripts: firebase-node.js and firebase-web.js.  The package.json lists "firebase-node.js" as the "main" script and should be used when you use firebase from node.  "firebase-web.js" is listed as the "browser" script and should be used with bower / webpack / etc. when you're using the node module in the browser.

Sometimes people end up in strange situations where they end up trying to use the wrong one in the wrong place (firebase-web in node or firebase-node in the browser) and that doesn't work out very well.

In this case, hopefully Jacob's suggestion to deploy node_modules is all you need, but I'm not sure what you're going for.

Best regards,
-Michael


Daveyon Mayne

unread,
Sep 3, 2015, 3:28:35 PM9/3/15
to Firebase Google Group
Thanks.

I use the firebase cdn. I want to, just now, implement xero in my web app but I am struggling to require a module or load in a module.

I am still learning but I think I'm doing everything but the book. 
Reply all
Reply to author
Forward
0 new messages