so before we continue let's set up a
path alias so we can import files using
root which means the root of our project
so if you have nested imports you don't
have to do
the gymnastics with
traversing your file structure and so on
you probably know what i'm talking about
so you can set up as many of path
aliases as you want so for example you
can have a components a style specialist
and so on but i prefer to keep it simple
and i'm using the dollar prefix because
that's what swell kit uses and if you're
using swell kit you don't have to set
this up it's going to be set up for you
automatically and i think they use the
lib one by default but also in there you
can change it and what's awesome about
pave alias is this isn't something
specific to swelt or wheat for that
matter if you're using react or any
other framework you can easily set up f
aliases and they're awesome
so let's quickly set that up so if we go
to the wii config js let me just hide
this
so we can import
the path
module i can type from path
and then we just need to add a resolve
option
and reading i have to say reading the v
documentation is a bit cryptic let's say
for example i just want to show this for
example
if we go here
let's say get started
and let me just look for alias right
alias
yeah result alias so this is what you
would see in the documentation and this
is kind of hard to understand like what
are they talking about like there i wish
there was more examples in the vid
documentation because
if you don't search for it around you
won't figure out how to set this up
yourself trust me
but yeah it's basically saying it's like
an object so resolve and then alias is
nested and it gives you an option but
anyhow i'm not going to go on a tangent
so yeah let's go back here and as it
says like resolve right and this is
awesome typescript already proving it's
worth
so you can say resolve and you can say
an object
and we say alias thank you typescript
you're so awesome and then we can define
our paths right so it's going to be rude
but this can be anything right so you
can say banana or you can even change
this it can be
add banana i don't know why you would do
that but okay
so we can say path resolve and then we
want to say
what it should be and that should be
source right so let's save everything
and this is a step if you're using
typescript so
in the poster say if you're using
typescript you also need to let the
texture compiler know about this so if
you look at our
file structure you can see here is ts
config.json
and let me just
place the base url here
yeah let's just set paths and then we
can start an object
and then we can add
dollar sign root
everything after root
and then we can also say we have to use
bubble codes you can say source
everything and then typescript won't
complain when we import files and it's
going to give us awesome auto completion