Installation
The installation process for Unitools is straightforward. You can install the required packages using npm
or yarn
.
Next.js
Run the following commands to install all the packages supported under unitools.
npm install @unitools/image @unitools/link @unitools/router @unitools/tailwindcss-fonts @unitools/fonts @unitools/image-next @unitools/link-next @unitools/router-next
yarn add @unitools/image @unitools/link @unitools/router @unitools/tailwindcss-fonts @unitools/fonts @unitools/image-next @unitools/link-next @unitools/router-next
Expo
Run the following commands to install all the packages supported under unitools.
npm install @unitools/image @unitools/link @unitools/router @unitools/tailwindcss-fonts @unitools/fonts @unitools/image-expo @unitools/link-expo @unitools/router-expo
yarn add @unitools/image @unitools/link @unitools/router @unitools/tailwindcss-fonts @unitools/fonts @unitools/image-expo @unitools/link-expo @unitools/router-expo
Install the required peer-dependencies.
npm install expo-image expo-router
yarn add expo-image expo-router
Configuration
For @unitools/image
, @unitools/link
, and @unitools/router
to work in Next.js we need to alias
it with @unitools/image-next
, @unitools/link-next
, and @unitools/router-next
respectively
config . resolve . alias [ ' @unitools/image ' ] = ' @unitools/image-next ' ;
config . resolve . alias [ ' @unitools/link ' ] = ' @unitools/link-next ' ;
config . resolve . alias [ ' @unitools/router ' ] = ' @unitools/router-next ' ;
config . resolve . alias [ ' @unitools/fonts ' ] = ' @unitools/fonts/next ' ;
For @unitools/image
, @unitools/link
, and @unitools/router
to work in Expo we need to alias
it with @unitools/image-expo
, @unitools/link-expo
, and @unitools/router-expo
respectively
" @unitools/link " : " @unitools/link-expo " ,
" @unitools/image " : " @unitools/image-expo " ,
" @unitools/router " : " @unitools/router-expo " ,
" @unitools/fonts " : " @unitools/fonts/expo " ;