- import { Checkbox } from "@components/Input";
+ import { Checkbox } from "@/components/Input";
Reason
The main reason is to avoid clashing with the names of node modules.
For example, the following code will cause an error when trying to import from types/GuiBuilder/ folder
This is because our node_modules/ folder also has a folder called @types/ that stores the types of JavaScript libraries (e.g. @types/d3). Hence, using a custom import path alias of @types will clash with the node modules. (See this Stack Overflow thread)
Description
We should update the import path alias from
@xxx
to@/xxx
intsconfig.json
:So importing stuff would become:
Reason
The main reason is to avoid clashing with the names of node modules.
For example, the following code will cause an error when trying to import from
types/GuiBuilder/
folderThis is because our
node_modules/
folder also has a folder called@types/
that stores the types of JavaScript libraries (e.g.@types/d3
). Hence, using a custom import path alias of@types
will clash with the node modules. (See this Stack Overflow thread)