The following statement resolved correctly as I have an index.ts file in the lessons directory:
import Lesson1 from 'lessons'.
However, if I try to access the following import Lesson1 from 'lessons/01/Lesson1' I get the following error message: Unable to resolve "./lessons/index.ts/01/Lesson01" from "src/index.tsx"
So it seems as though the file name of the file referencing the alias is being added to the path structure: ./lessons/index.ts/01/Lesson01.
Could someone enlighten me on how to make this work please?
Thanks in advance.
Hi.
So I have the following structure:
src/lessons/01/Lesson01.tsx
I've setup the following in mybabel.config.js
The following statement resolved correctly as I have an index.ts file in the
lessons
directory:import Lesson1 from 'lessons'
. However, if I try to access the followingimport Lesson1 from 'lessons/01/Lesson1'
I get the following error message:Unable to resolve "./lessons/index.ts/01/Lesson01" from "src/index.tsx"
So it seems as though the file name of the file referencing the alias is being added to the path structure: ./lessons/index.ts/01/Lesson01.
Could someone enlighten me on how to make this work please? Thanks in advance.