Closed pamidur closed 7 years ago
There might be the case when file actually exists and I want to import everything from it, but specify file without extension.
Example
-model |-people.js |-work.js
...with several exported classes each
I might want
import * as model from './model' import * as people from './model/people'
First case works as expected - it imports everything from folder Second case throws an exception
Error: server/services/reports.js: ENOENT: no such file or directory, stat 'server/model/people'
So this PR fixes this behavior by checking if folder actually exists, and assumes this was file with missing extension otherwise.
There might be the case when file actually exists and I want to import everything from it, but specify file without extension.
Example
...with several exported classes each
I might want
First case works as expected - it imports everything from folder Second case throws an exception
So this PR fixes this behavior by checking if folder actually exists, and assumes this was file with missing extension otherwise.