Skip to content
This repository has been archived by the owner on Aug 4, 2021. It is now read-only.

Commit

Permalink
Update README.md with note on symlinks
Browse files Browse the repository at this point in the history
This addresses the confusion reported in #402 

IMO it would be nice to make this easier on people by supporting includeModule/excludeModule, but in the meantime we should document symlinks a bit better.
  • Loading branch information
bterlson committed Aug 20, 2019
1 parent de40daa commit 5a0aa6f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,16 +66,18 @@ export default {
};
```

### Usage in monorepo
### Usage with Symlinks

In case you are using a monorepo, you may want to use a regular expression for `include` as the string 'node_modules' will not match if your `node_modules` is not in your current working directory (i.e. '../node_modules'). Try this:
Symlinks are common in monorepos and are also created by the command `npm link`. Rollup with rollup-plugin-node-resolve resolves modules to their real paths by default. So include and exclude paths should handle real paths not symlinked paths (e.g. `../common/node_modules/**` instead of `node_modules/**`). You may also use a regular expression for `include` that works regardless of base path. Try this:

```
commonjs({
include: /node_modules/
})
```

Whether symlinked module paths are realpathed or preserved depends on Rollup's preserveSymlinks setting. It is false by default, matching Node's default behavior. Setting preserveSymlinks to true in your Rollup config will cause import and export to match based on symlinked paths.

### Custom named exports

This plugin will attempt to create named exports, where appropriate, so you can do this...
Expand Down

0 comments on commit 5a0aa6f

Please sign in to comment.