Skip to content

Unitools | Getting Started | By GeekyAnts

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.

Terminal window
npm install @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.

Terminal window
npm install @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.

Terminal window
npm install 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

next.config.js
module.exports = {
webpack: (config) => {
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';
return config;
},
};