Skip to content

plugin for browserify to resolve symlinks to realpaths, to make transforms work for symlinked local modules

Notifications You must be signed in to change notification settings

zoubin/realpathify

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

realpathify

Deprecated

Browserify has fixed the problem in this commit.

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.

However, transforms applied in browserify won't work on modules whose resolved 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

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.

About

plugin for browserify to resolve symlinks to realpaths, to make transforms work for symlinked local modules

Resources

Stars

Watchers

Forks

Packages

No packages published