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

Add info how to install locally #2995

Merged
merged 7 commits into from Aug 11, 2019
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
27 changes: 27 additions & 0 deletions docs/04-tutorial.md
Expand Up @@ -127,6 +127,33 @@ rollup --config rollup.config.dev.js
rollup --config rollup.config.prod.js
```

### Using Rollup locally

When working with multiple environments or in a team, it's often smart to add Rollup as a _local_ dependency. This way you don't have to remember (or remind team members) to install Rollup globally and you can make sure everyone is using the same version.

To install Rollup locally you can simply do:

```console
npm i -D rollup
// OR yarn -D add rollup
```

Now you can run it inside the root folder of your project like so:

```console
./node_modules/.bin/rollup --config
```

In this case it's best to just add this command as a script to your `package.json`:

```json
{
"scripts": {
"build": "./node_modules/.bin/rollup --config"
shellscape marked this conversation as resolved.
Show resolved Hide resolved
}
}
```

### Using plugins

So far, we've created a simple bundle from an entry point and a module imported via a relative path. As you build more complex bundles, you'll often need more flexibility – importing modules installed with NPM, compiling code with Babel, working with JSON files and so on.
Expand Down