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

Update README.md with note on symlinks #405

Merged
merged 4 commits into from Aug 22, 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
6 changes: 4 additions & 2 deletions README.md
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:
bterlson marked this conversation as resolved.
Show resolved Hide resolved

```
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 instead.
bterlson marked this conversation as resolved.
Show resolved Hide resolved

### Custom named exports

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