rollup / rollup-plugin-commonjs

This module has moved and is now available at @rollup/plugin-commonjs / https://github.com/rollup/plugins/blob/master/packages/commonjs
MIT License
501 stars 126 forks source link

namedExports doesn't work with symlinked node_modules #400

Closed bterlson closed 5 years ago

bterlson commented 5 years ago

If you pass preserveSymlinks: false to rollup-plugin-node-resolve, and your node_modules directory's contents are symlinked, then the namedExports config key doesn't work properly. This plugin creates a map with keys containing symlinked paths, whereas rollup asks it about real paths.

I found this because resolve 1.11.1 had a bug in its preserveSymlinks: false behavior where it would not realpath some symlinks. With that fixed in 1.12.0, namedExports stopped working.

I'm happy to write up a PR for fixing this if needed. Maybe can realpath the result of resolve and map that as well.