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

Make empty string a valid extension option #21

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

kalefranz
Copy link

I have a use case of gulp-swig where I use a .swig extension on the input files...something like template.html.swig. I would like gulp-swig to be able to just remove the extension entirely--i.e. use an empty string for opts.ext. An empty string, however, is falsy, and so this pull request addresses my use case. The current behavior is mostly unchanged, as the default .html extension is still applied if opts.ext is null or undefined.

@colynb
Copy link
Owner

colynb commented Nov 5, 2014

To be honest, the opts.ext option was put in very early before some gulp best practices. I was thinking of taking out that completely in favor of using gulp-rename for managing changes to the file name/extension. https://www.npmjs.org/package/gulp-rename

@colynb
Copy link
Owner

colynb commented Nov 5, 2014

by best practices, I mean, plugins shouldn't bake-in things that other plugins are much better at doing... encouraging a more modular eco-system.

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 this pull request may close these issues.

2 participants