Open albertfdp opened 6 years ago
Seems like a legit bug.
Thanks for volunteering to create a PR - that's the spirit! I'd only recommend adding filename
to the test options (can point e.g. to './test/testproject/src/components/App.js'
because it has a sibling index.js
file) and using './test/testproject/src'
as root
.
It seems that requiring a sibling
index.js
file in a folder with therequire('.')
notation stopped working since https://github.com/tleunen/babel-plugin-module-resolver/pull/253I usually have the following structure for components:
and I'd require the file on
spec.js
with:This stopped working on 3.1.0 and I need to
require('./index.js')
which is a bit cumbersome and also in nodejs it's standard to resolverequire('.')
to the sibling index.js file.This is an example breaking test, which passes before https://github.com/tleunen/babel-plugin-module-resolver/commit/7dc2da6fe2deb26c1cb717a1a10aca048217dc82
I'm happy to help with a PR or to complement with more details. Thanks!