Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
H
heroku-buildpack-nodejs
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Python-Dev
heroku-buildpack-nodejs
Commits
94c359d5
Commit
94c359d5
authored
Dec 10, 2014
by
Hunter Loftis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update readme with more config instructions
parent
4fbaca42
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
102 additions
and
1 deletion
+102
-1
README.md
README.md
+102
-1
No files found.
README.md
View file @
94c359d5
# Heroku Node.js Buildpack: Yoga
Preview the next version of the node buildpack: yoga. It's powerful and flexible.
Preview the next version of the node buildpack: yoga.
It's the most powerful and flexible Node buildpack yet.
```
shell
heroku config:set
BUILDPACK_URL
=
https://github.com/heroku/heroku-buildpack-nodejs#yoga
...
...
@@ -17,6 +18,106 @@ git push heroku master
-
Go crazy with
`.npmrc`
configs
-
Export
`NODE_HOME`
and
`PATH`
for better integration with multiple buildpacks
## Use
### Specify a node version
Set engines.node in package.json to the semver range
(or specific version) of node you'd like to use.
(It's a good idea to make this the same version you use during development)
```
json
"engines"
:
{
"node"
:
"0.11.x"
}
```
```
json
"engines"
:
{
"node"
:
"0.10.33"
}
```
Default: the
[
latest stable version.
](
http://semver.io/node
)
### Specify an npm version
Set engines.npm in package.json to the semver range
(or specific version) of npm you'd like to use.
(It's a good idea to make this the same version you use during development)
```
json
"engines"
:
{
"npm"
:
"2.x"
}
```
```
json
"engines"
:
{
"npm"
:
"^2.1.0"
}
```
Default: the version of npm bundled with your node install (varies).
### Enable or disable node_modules caching
Sometimes it's necessary to be able to build without any cache present.
Caching node_modules between builds can dramatically speed up build times.
However,
`npm install`
doesn't automatically update already installed modules
as long as they fall within acceptable semver ranges.
```
shell
heroku config:set
BUILD_CLEAN
=
true
git commit
-am
'build'
--allow-empty
git push heroku master
heroku config:unset BUILD_CLEAN
```
Default:
`BUILD_CLEAN`
defaults to false
### Enable or disable devDependencies installation
During local development,
`npm install`
installs all dependencies
and all devDependencies (test frameworks, build tools, etc).
This is usually something you want to avoid in production, so
npm has a 'production' config that can be set through the environment:
To install
*dependencies only:*
```
shell
heroku config:set
NPM_CONFIG_PRODUCTION
=
true
```
To install
*dependencies and devDependencies:*
```
shell
heroku config:set
NPM_CONFIG_PRODUCTION
=
false
```
Default:
`NPM_CONFIG_PRODUCTION`
defaults to true on Heroku
### Configure npm with .npmrc
Sometimes, a project needs custom npm behavior to set up proxies,
use a different registry, etc. For such behavior,
just include an
`.npmrc`
file in the root of your project:
```
# .npmrc
registry = 'https://custom-registry.com/'
```
### Chain Node with multiple buildpacks
Frequently, Node is paired with other platforms like Ruby or PHP
through Heroku's Multi Buildpack. In order to use node in
another environment, specify this buildpack first in your .buildpacks file.
This buildpack automatically exports node, npm, and any node_modules binaries
into the
`$PATH`
for easy use in subsequent buildpacks.
## Roadmap
The next features in the pipeline include:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment