Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pass pkg.__dirname to transform functions #112

Open
shinout opened this issue Feb 8, 2016 · 0 comments
Open

pass pkg.__dirname to transform functions #112

shinout opened this issue Feb 8, 2016 · 0 comments

Comments

@shinout
Copy link

shinout commented Feb 8, 2016

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant