Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
jokade committed Jul 16, 2017
1 parent 8b6d27e commit f9af0fd
Showing 1 changed file with 38 additions and 1 deletion.
39 changes: 38 additions & 1 deletion README.md
@@ -1,2 +1,39 @@
# sbt-node
sbt plugin for integration with Node.js / npm
Plugins for integration of Node.js based build tools with sbt.

## Getting Started

Add this to your `project/plugins.sbt`
```scala
addSbtPlugin("de.surfice" % "sbt-node" % "0.0.1")
```
and then enable the plugins you want to use (see below) for your project(s) in `build.sbt`:
```scala
lazy val root = project.in(file("."))
.enablePlugins(NpmPlugin, /* ... */)
/* ... */
```

## Plugins
### NpmPlugin
This is the foundation required by all other plugins, but it can also be used on its own.
It provides integration with the `npm` tool:
- defining basic `npm` settings including dependencies and scripts
- generating the `package.json` for the project
- installing dependencies and running npm tasks

#### Settings
- **`npmTargetDir`**: the root directory of the Node.js project; `node_modules` will usually be installed here
- **`npmDependencies`**: list of npm dependencies (name and version) the application/ library depends on at run time.\\
 *Example*: `npmDependencies ++= Seq("rxjs" -> "^5.0.1")`
- **`npmDevDependencies`**: list of npm compile time / development dependencies.\\
 *Example*: `npmDevDependencies ++= "Seq("lite-server" -> "^2.2.2")`
- **`npmScripts`**: map of `script` entries to be added to the `package.json` file.\\
 *Example*: `npmScripts ++= Seq( "start" -> "lite-server" )`

#### Tasks
- **`npmInstall`**: updates the `package.json` file and installs all dependencies.
- **`npmRunScript <NAME>`**: runs the npm script `NAME` (must be defined in `npmScripts`). If the script does not stop on its own, it can be killed by pressing RETURN in the sbt console.

### SystemJSPlugin
TBD

0 comments on commit f9af0fd

Please sign in to comment.