Skip to content

pass pkg.__dirname to transform functions #112

Open
@shinout

Description

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.

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions