JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 654
  • Score
    100M100P100Q105009F
  • License MIT

plugin for browserify to resolve symlink to realpath, to make transforms work for symlinked local modules

Package Exports

  • realpathify

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (realpathify) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

realpathify

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.