Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/zoubin/realpathify
plugin for browserify to resolve symlinks to realpaths, to make transforms work for symlinked local modules
https://github.com/zoubin/realpathify
Last synced: 8 days ago
JSON representation
plugin for browserify to resolve symlinks to realpaths, to make transforms work for symlinked local modules
- Host: GitHub
- URL: https://github.com/zoubin/realpathify
- Owner: zoubin
- Created: 2015-07-03T09:01:57.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2016-01-15T15:25:30.000Z (almost 9 years ago)
- Last Synced: 2024-10-31T18:55:12.024Z (18 days ago)
- Language: JavaScript
- Homepage:
- Size: 8.79 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# realpathify
**Deprecated**Browserify has fixed the problem in this [commit](https://github.com/substack/node-browserify/commit/504832b4b9fde30c36877122b265ddccbea7be77).
plugin for browserify to resolve symlinks to their realpaths, to make transforms work for symlinked local modules
substack has recommended a nice way of organizing your local modules in [browserify-handbook](https://github.com/substack/browserify-handbook#symlink).
However, transforms applied in browserify won't work on modules whose [resolve](https://www.npmjs.com/package/resolve)d paths containing `node_modules` by default. So, if you symlink your local modules in `node_modules`, you probably have to figure out some way to make transforms applied to them.
This module presents a way to do that, by hacking `b._bresolve`, to make it resolve symlinked subdirectories in `node_modules` to their real paths, so `module-deps` won't treat them as global modules, and apply transforms to them.
## Usage
```javascript
var b = browserify(bOpts);
var realpathify = require('realpathify');
b.plugin(realpathify, { filter: ['local_module'] });```
## b.plugin(realpathify, opts)
### opts
#### filter
Type: `String`, `Array`
`Optional`
If you specified the `filter` option, then only subdirectories contained in it will be realpathified. It makes `realpathify` work more fast.
If not specified, `realpathify` will try to resolve all subdirectories in `node_modules`.
## realpathify.async(asyncResolve, filter)
Return a realpathified async resolve function.
## realpathify.sync(syncResolve, filter)
Return a realpathified sync resolve function.
## realpathify.realpath(file, filter, cache)
Resolve `file` to realpath.