zordius / gulp-jsx-coverage

deprecated
https://www.npmjs.com/package/gulp-jsx-coverage
Other
34 stars 10 forks source link

added jsx extension to coverage #11

Closed technicallyfeasible closed 9 years ago

technicallyfeasible commented 9 years ago

this allows require('./Component') to also find Component.jsx without explicitly adding the extension

zordius commented 9 years ago
  1. We strongly suggest people to use exact file name when require('nonejsfiles.exact_ext') .
  2. This patch may good for require('Component') and require('Component.jsx') , but do not do the same behavior for require('drink.coffee') <==> require('drink') .
  3. Maybe we can introduce this feature as a new option, but not a default behavior.
technicallyfeasible commented 9 years ago
  1. I am maintaining an existing codebase where the extensions are mostly omitted and would rather not change all of those files.
  2. if we added the same change for 'coffee' then it would fallback to coffee as well so you could omit the extension and it would first look for js, then jsx and then coffee
  3. Alternatively, an option like defaultExtension could work that adds the change only for this extension
zordius commented 9 years ago

Yes, for your 2. that's why we suggest to use full file name...or the omitted extension will cause ambiguous.

I will work on the defaultExtension option for this issue later, please wait for my update , thanks.

zordius commented 9 years ago

new version v0.2.3 released for this, thanks. The new option is options.transpile.babel.omitExt , please check README.md .