---
title: "Discussion on \"Setting up a monorepo with Vite, Typescript, and pnpm workspaces\" | Hashnode"
description: "Discussion on \"Setting up a monorepo with Vite, Typescript, and pnpm workspaces\". Learn how to set up a monorepo with Vite, Typescript and pnpm workspaces."
url: "https://hashnode.com/posts/setting-up-a-monorepo-with-vite-typescript-and-pnpm-workspaces/63ce0bd684fad71a166baa6e"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Setting up a monorepo with Vite, Typescript, and pnpm workspaces](https://vedanshmehra.hashnode.dev/setting-up-a-monorepo-with-vite-typescript-and-pnpm-workspaces?utm_source=hashnode&utm_medium=feed)

Learn how to set up a monorepo with Vite, Typescript and pnpm workspaces.

Jan 23, 2023 · 6 min read · vedanshmehra.hashnode.dev  
Read the article

-   [#monorepo](https://hashnode.com/tag/monorepo)
-   [#typescript](https://hashnode.com/tag/typescript)
-   [#vite](https://hashnode.com/tag/vite)
-   [#pnpm](https://hashnode.com/tag/pnpm)

## Written by

[Vedansh Mehra](https://hashnode.com/@imvedanshmehra)

@imvedanshmehra · India

  
[View profile](https://hashnode.com/@imvedanshmehra)

i build products, solve engineering problems, and document the process.

Builder

## Responses 1

Markdown supported · ⌘↵ to post

[Lars Rye Jeppesen](https://hashnode.com/@spock123)

[Apr 4, 2023](https://hashnode.com/posts/setting-up-a-monorepo-with-vite-typescript-and-pnpm-workspaces/63ce0bd684fad71a166baa6e/comment/642bd15339fb0f053a10629e)

Hi, how do you solve the issue with compilation? tsc for example ,cannot use the shared library source code, it requires a compile shared library.

Once you start using the build version of shared libraries, then you run into the issue of having to compile every time there is a change in a library - and so does every other developer using the same monorepo.

Is there a way to let the typescript compiler use the src from shared?

[Vedansh Mehra](https://hashnode.com/@imvedanshmehra)

[Apr 6, 2023](https://hashnode.com/posts/setting-up-a-monorepo-with-vite-typescript-and-pnpm-workspaces/63ce0bd684fad71a166baa6e/comment/642bd15339fb0f053a10629e#reply-642eac46d5c9e428d8ee1a00)

Hi, thank you for taking the time to read this article ❤️

TBH, I have not run into this situation by myself so far but I see your point, I have read that a few packages like ttypescript and ts-node can help us do that but I am yet to explore that.

Maybe I'll write a new article on this very soon once I explore more about it.

[Lars Rye Jeppesen](https://hashnode.com/@spock123)

[Apr 6, 2023](https://hashnode.com/posts/setting-up-a-monorepo-with-vite-typescript-and-pnpm-workspaces/63ce0bd684fad71a166baa6e/comment/642bd15339fb0f053a10629e#reply-642f393a7a31ea30695e4a20)

[Vedansh Mehra](https://hashnode.com/@imvedanshmehra)

For smaller libraries, I found that esbuild-based bundlers like tsup are great for this (that is what I ended up using anyways). cheers
