module-deps icon indicating copy to clipboard operation
module-deps copied to clipboard

pass pkg.__dirname to transform functions

Open shinout opened this issue 9 years ago • 0 comments

As we cannot write __dirname to package.json, transforms which require directories must be given relative paths.

package.json

{
  "browserify": {
    "transform": [
      ["transform1", {"dirname": "relative/path"} ]
    ]
  }
}

However, there is no way to resolve absolute paths. process.cwd() varies by where node process is created.

Pass pkg.__dirname to transform functions and we can calculate absolute paths from where the package.json file is located.

shinout avatar Feb 08 '16 09:02 shinout