Closed thetallweeks closed 8 years ago
This is more of a question. I'm confident that I just can't find the right config options for this.
I want to be able to import files like: import SomeReactComponent from '../../SomeReactComponent'
import SomeReactComponent from '../../SomeReactComponent'
without requiring the .jsx extension. E.g. '../../SomeReactComponent.jsx'
.jsx
'../../SomeReactComponent.jsx'
Right now, this is my gulp-jsx-coverage config:
{ src: [ 'test/**/*+(.js|.jsx)', 'src/**/*.js', 'src/**/components/*.jsx' ], isparta: false, istanbul: { preserveComments: false, coverageVariable: '__MY_TEST_COVERAGE__', exclude: /node_modules|test/ }, transpile: { babel: { include: /\.jsx?$/, exclude: /node_modules/, omitExt: false } }, coverage: { reporters: ['text-summary', 'json', 'lcov'], directory: 'coverage' }, mocha: { reporter: 'spec' }, babel: { plugins: ['transform-runtime'] }, //optional cleanup: function () { // do extra tasks after test done // EX: clean global.window when test with jsdom } }
I've done some research but haven't found what to add and where. Do you have an idea of what config option I need to add for this?
You can try to change the line omitExt: false into omitExt: ['.jsx']
omitExt: false
omitExt: ['.jsx']
Works great! Thank you!
This is more of a question. I'm confident that I just can't find the right config options for this.
I want to be able to import files like:
import SomeReactComponent from '../../SomeReactComponent'
without requiring the
.jsx
extension. E.g.'../../SomeReactComponent.jsx'
Right now, this is my gulp-jsx-coverage config:
I've done some research but haven't found what to add and where. Do you have an idea of what config option I need to add for this?