Fix so nonexistant dirs throw an error

main
Ashelyn Dawn 5 years ago
parent 54dbf7d05f
commit 2a99d325da

@ -35,12 +35,13 @@ class CustomResolver {
const resolvedDir = const resolvedDir =
path.join(__dirname, match.groups.dir, dirPath.join('/')) path.join(__dirname, match.groups.dir, dirPath.join('/'))
let selectedPath = request.request // Default to basic (no extension)
let selectedPath = path.join(resolvedDir, componentDir)
// Attempt a few paths with an extension, just in case
const pathsToCheck = [ const pathsToCheck = [
path.join(resolvedDir, componentDir, componentDir + '.js'), path.join(resolvedDir, componentDir, componentDir + '.js'),
path.join(resolvedDir, componentDir + '.js'), path.join(resolvedDir, componentDir + '.js')
path.join(resolvedDir, componentDir)
] ]
for(const path of pathsToCheck) for(const path of pathsToCheck)

Loading…
Cancel
Save