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

Not able to programatically specify what file extensions are included #16

Closed
matthewdunsdon opened this issue Feb 17, 2016 · 5 comments
Closed
Assignees

Comments

@matthewdunsdon
Copy link
Contributor

When using browserify-transform-tools (v 1.5.1), I am not able to programatically specify what file extensions to include (includeExtensions).

Partial code sample:

var DEFAULT_EXTENSIONS = ['.js']
var options = { includeExtensions: DEFAULT_EXTENSIONS }
var myStringTransform = transformTools.makeStringTransform("hello", options, function(content, transformOptions, done) {
    done(null, 'hello ' + content);
});
browserify({ entries: ['index.html'] })
    .transform(myStringTransform, { appliesTo: { includeExtensions: ['.html'] } })
    .bundle()
@matthewdunsdon matthewdunsdon changed the title The "appliesTo.includeExtensions" programatic configuration is not f Not able to programatically specify what file extensions are included Feb 17, 2016
@matthewdunsdon
Copy link
Contributor Author

Having a quick look at the code, the follow change may have caused the problem:

76829fa#diff-a801f5af448ba06bc6096727b57fa60eL58

@matthewdunsdon
Copy link
Contributor Author

I have not used coffeescript on a regular basis and am not sure if this is the correct place (in the code) to make the fix, so I have only created a reference commit (rather than a PR) showing sample fix and proposed test changes:

https://github.com/matthewdunsdon/browserify-transform-tools/commit/ec9e7b0f2fac3

@jwalton
Copy link
Contributor

jwalton commented Feb 17, 2016

Thanks for tracking this down so quickly! I'll have a look at your fix
tomorrow morning.
On Feb 16, 2016 8:57 PM, "Matthew Dunsdon" notifications@github.com wrote:

I have not used coffeescript on a regular basis and am not sure if this is
the correct place to make the fix, therefore I have created a reference
commit (rather than a PR) showing sample fix and proposed test changes:

matthewdunsdon@ec9e7b0
https://github.com/matthewdunsdon/browserify-transform-tools/commit/ec9e7b0f2fac3


Reply to this email directly or view it on GitHub
#16 (comment)
.

@jwalton jwalton self-assigned this Feb 17, 2016
@jwalton
Copy link
Contributor

jwalton commented Feb 17, 2016

Published as 1.5.2. Thanks @matthewdunsdon! I used almost exactly your fix.

@jwalton jwalton closed this as completed Feb 17, 2016
@matthewdunsdon
Copy link
Contributor Author

Looking at this further, I am not sure this quite solves all the edge cases. I have created PR #17 to address this.

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

No branches or pull requests

2 participants