{"action":"opened","issue":{"url":"https://api.github.com/repos/benbria/browserify-transform-tools/issues/7","labels_url":"https://api.github.com/repos/benbria/browserify-transform-tools/issues/7/labels{/name}","comments_url":"https://api.github.com/repos/benbria/browserify-transform-tools/issues/7/comments","events_url":"https://api.github.com/repos/benbria/browserify-transform-tools/issues/7/events","html_url":"https://github.com/benbria/browserify-transform-tools/issues/7","id":56634540,"number":7,"title":"Accept transform options provided upstream","user":{"login":"milotoor","id":4667801,"avatar_url":"https://avatars.githubusercontent.com/u/4667801?v=3","gravatar_id":"","url":"https://api.github.com/users/milotoor","html_url":"https://github.com/milotoor","followers_url":"https://api.github.com/users/milotoor/followers","following_url":"https://api.github.com/users/milotoor/following{/other_user}","gists_url":"https://api.github.com/users/milotoor/gists{/gist_id}","starred_url":"https://api.github.com/users/milotoor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/milotoor/subscriptions","organizations_url":"https://api.github.com/users/milotoor/orgs","repos_url":"https://api.github.com/users/milotoor/repos","events_url":"https://api.github.com/users/milotoor/events{/privacy}","received_events_url":"https://api.github.com/users/milotoor/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-02-05T06:53:43Z","updated_at":"2015-02-05T06:53:43Z","closed_at":null,"body":"Browserify's API for writing transforms allows transforms to accept two parameters: the `file` name, which is mandatory if the transform is to do anything meaningful; and `trOpts`, or transform options, which are optional but can be used by the transform if it so chooses.\r\n\r\nPresently, the `make*Transform` methods all return a function that accepts a `file` parameter but no `trOpts`. Consequently it's impossible for any parameters provided to the transform from somewhere upstream (i.e. via Browserify's own `b.transform` API, or a build tool such as grunt-browserify) to be processed by the created transform.\r\n\r\nI propose modifying the function signature of the `transform` function returned by `makeStringTransform` (see [`transformTools.coffee` line 53](https://github.com/benbria/browserify-transform-tools/blob/master/src/transformTools.coffee#L53)) from\r\n\r\n```coffeescript\r\ntransform = (file) ->\r\n```\r\n\r\nto\r\n\r\n```coffeescript\r\ntransform = (file, opts) ->\r\n```\r\n\r\nand to change the `transformOptions` from\r\n\r\n```coffeescript\r\ntransformOptions = {\r\n    file: file,\r\n    configData, configData,\r\n    config: configData?.config\r\n}\r\n```\r\n\r\nto\r\n\r\n```coffeescript\r\ntransformOptions = {\r\n    file: file,\r\n    configData, configData,\r\n    config: configData?.config,\r\n    opts: opts\r\n}\r\n```\r\n\r\nThoughts?"}}