All Questions
41
questions
11
votes
1
answer
6k
views
How can I get live-reload on a local npm package in a monorepo?
I'm setting up a monorepo workspace for a Vue 3 (vite + ts), cloud functions, & shared-lib (shared functions and ts interfaces etc.).
I can get the import of my local shared-lib folder to work. I ...
8
votes
1
answer
3k
views
"ReferenceError: exports is not defined" for a TypeScript + SvelteKit monorepo using pnpm
I'm trying to build a monorepo around my SvelteKit app, where the app and various monorepo packages are all written in TypeScript.
The SvelteKit app works fine, until I try to symlink in one specific ...
8
votes
2
answers
3k
views
pnpm & vue & vite monorepo - resolve import of alias path inside a workspace package
I'm building a monorepo of UI applications using shared components and style using pnpm, typescript, vue, and vite.
While trying to leverage pnpm's workspace ecosystem to ease the development ...
7
votes
2
answers
7k
views
How to share Vite config in monorepo?
I am trying to make monorepo using Turborepo. I have a lot of Vue projects there and I need to share Vite config across all applications. Here's how I'm trying to achieve this.
I have package named @...
6
votes
3
answers
7k
views
Migrating a Create React App (Webpack) to NX and Vite - URI malformed at decodeURI
This is going to be a tricky one because there's a lot going on in here. Therefore, I'll try to be as succinct as possible not to overload you with too much information.
I'm currently in the process ...
5
votes
1
answer
3k
views
Ambiguous aliases in Vite monorepo
The problem occurs for Vite monorepo, @ aliases are respected by TypeScript because of separate tsconfig files (can be visible in IDE) but aren't distinguished among the workspaces by Vite on build.
...
4
votes
0
answers
954
views
How to make Vite copy static assets from package dependency into output folder?
Tldr
I have a dependency of my Vite app that has JS files which import images. I want my Vite app to import those JS files properly, including copying the images to the final build.
Instead, when ...
4
votes
0
answers
396
views
How to setup a Typescript mono-repo with multilevel dependency graph without going through build cycles?
I have a typescript mono-repo containing 3 packages as follows:
Package A: a React Single-Page-Application which uses packages B and C.
Package B: a UI library which uses Package C.
Package C: a ...
3
votes
1
answer
5k
views
Vite creating its own node_modules in workspace instead of using monorepo
I have a monorepo for a fullstack webapp with the following directory structure
.
├── client
│ ├── index.html
│ ├── package.json
│ ├── src
│ └── vite.config.ts
├── node_modules
├── package-...
3
votes
0
answers
200
views
Yarn monorepo performance issues during development: Many "The code generator has deoptimised the styling" messages
My monorepo looks as follows:
app1
packages/package1
packages/packageN
This is a yarn 3 monorepo with turborepo for caching build assets.
App1 consumes package1.
App1 is a simple Vite React app.
...
3
votes
0
answers
430
views
In a nested TS based Vite + Vue3 project I can "build" but cannot "dev"
I have a nested TS project with Vue3 + Vite living in a subdirectory directly under the project's root. That Vue3 project imports types and consts from src of the root project. I managed the types ...
2
votes
2
answers
16k
views
How to serve Vite development server behind an Nginx reverse proxy
I'm working on a Typescript monorepo using turborepo that holds multiple microservices (nextjs, expressjs, create-react-app).
each of these microservices is served in its own PORT.
In order to make ...
2
votes
1
answer
2k
views
Workable setup for pnpm monorepo w. typescript, vite & rollup
I build a monorepo using pnpm workspaces and I have trouble getting it work. It uses typescript, vite on frontends, rollup at backend microservices.
Here is the setup:
package.json ...
2
votes
3
answers
1k
views
Is it possible to form a multi-level monorepo (Q about tooling & structure)?
I'm in the research phase for converting my repos into a monorepo and further divide the codebase as of early 2023.
I use TypeScript
I have several servers and I want to divide them into ...
2
votes
1
answer
951
views
How to properly import a shared external react component inside a react app in NX monorepo?
I am using NX to create an integrated monorepo . I created a react app using --js flag, then I changed the js files to jsx. After I created a shared component in libs folder using this command and the ...
2
votes
0
answers
639
views
Vite, monorepo with yarn workspace and SCSS
Have a monorepo with several packages that depend on a module @carbon/styles, a module that provides only SCSS files.
Because this is a common dependency, the package is hoisted to the root ...
2
votes
1
answer
1k
views
How to deploy an application from a monorepo with a shared library?
I'm trying to deploy an app that is on a monorepo that imports a library that is inside this same repo, I'm using pnpm as packager manager
pnpm-workspace.yaml
packages:
- "packages/common/ui&...
2
votes
1
answer
1k
views
Npm workspaces: Different "main" property for development and publishing?
I've created an npm workspace with two packages "foo" and "bar".
Furthermore, I'm using typescript so both packages contain a src/index.ts.
During development, I want to have the &...
1
vote
1
answer
1k
views
Should we bundle shared component library separately in lerna monorepo?
I have three packages inside standard lerna monorepo.
client
react library
core
Core - is a shared component library with some utils (may or may not publish on npm).
React library is component ...
1
vote
0
answers
20
views
browser still in loading state after adding a lib for my components nx monorepo
Current Behavior
browser still in loading state after adding a lib for my components im using nx monorepo with react and vite
Expected Behavior
the app to be loaded and shown the ui in browser
Steps ...
1
vote
0
answers
157
views
How to include types coming from private internal packages in the final build of a react lib with Vite?
When I try to build my react lib using vite, I'm having the declaration file which is not including type definitions coming from my internal package.
I had this monorepo setup:
packages
internal
...
1
vote
0
answers
226
views
Vite environment variables missing when building a React App with NX
I'm currently working on a monorepo project using NX and Vite. I have multiple .env files for our multiple deployment environments:
.env.dev
.env.stg (staging)
.env.prod (production)
My problem is, ...
1
vote
3
answers
1k
views
Angular 17 library and webapp in monorepo: ng build works but ng serve fails with a dependency resolution problem
Problem
I have an Angular 17 web app in a monorepo that builds fine with ng build but fails on running ng serve with many “Failed to resolve dependency: , present in ‘optimizeDeps.include’" ...
1
vote
0
answers
138
views
How to prevent class duplication in a mono repo that uses tailwindcss for UI and frontend both?
I have a pnpm mono repo project with two packages: ui and frontend. I use the same config (copy/paste) for both packages. When I build the project, the ui package is built first, and its classes are ...
1
vote
0
answers
517
views
Creating workspace component Library with vite for monorepo react
I currently have a monorepo and I am looking to export all of my components into a new vite app within that repo and export the components into the current application
When I look online everything ...
1
vote
0
answers
100
views
Vite developement server behind HAPROXY
I'm working on a Typescript monorepo using NX that holds multiple services (CRA / hapi). All of these services are dockerised and served in their own port.
To bundle them all as a single app, we added ...
1
vote
0
answers
1k
views
Vite monorepo - internal dependencies with dev server
I have a monorepo setup with Typescript, Lerna, Yarn Workspaces where I am introducing Vite.
Rough repo setup:
packages/
app/
src/
index.tsx
App.tsx
package.json (`library` ...
1
vote
1
answer
663
views
Nx 16 failed to resolve library path in react (js) integrated mono repo
Hi guys I'm new to NX Monorepo. I simply follow the instruction of how to create Integrated React Monorepo from NX official website.
this link right here
I exactly follow the instruction.
but i have ...
1
vote
0
answers
86
views
How to build nodejs application with vitejs
my typescript application has 2 parts in a monorepo:
a frontend in react, built with vitejs
a backend with fastify, built with tsup
I want to use only one builder: vitejs with esbuild.
I find many ...
1
vote
0
answers
135
views
SyntaxError: Unexpected token 'export' when import monorepo package
I import package in vite.config.ts, it will throw syntax error
But it can be successfully imported in app.vue, I don't know why
my files tree
- packages
- components
- yep-ui
- playground
- ...
0
votes
4
answers
5k
views
Tailwind config for packages in monorepo
I am trying to create a monorepo using Vite, React, TailwindCSS and pnpm (repository here).
My tailwind config files are under src/apps/app. When using the Page from src/packages/feat-page, the ...
0
votes
0
answers
18
views
Vitest fails when testing a typescript file
So I have a monorepo with a package called "types".
In this package I have installed vitest and I want to test this file:
src/marketplaces.ts
import { z } from 'zod';
export const ...
0
votes
1
answer
67
views
`RollupError: [commonjs--resolver] Expression expected` when building the project in Vite
I have a project that includes a React Native project and a Vite (React Native Web) project in a monorepo using pnpm. When I build the Vite project, I am getting the error:
error during build:
...
0
votes
1
answer
74
views
How to solve cache problems with npm workspaces and Vite in a monorepo
I'm using npm workspaces with Vite in a svelte project (using SvelteKit).
The architecture of my project looks like this :
- apps/
- project-a/
- package.json
- vite.config.ts
- ...
0
votes
1
answer
187
views
AWS amplify not recognizing vite react NX monorepo
I have a new NX monorepo with 3 apps. Two of them are bundled with Vite and one is a NextJS project.
When I deploy the vite app to AWS Amplify it recognizes the app folder as NextJS-SSR! It also ...
0
votes
1
answer
133
views
Why do I need a tsconfig.json in each subdirectory, even if it only extends the root?
I'm trying to trim down the config files within my frontend mono repo, using Vite with react and Typescript. In the root of my repo, I've defined a tsconfig.json file that includes all necessary ...
0
votes
0
answers
51
views
Adding Vite to (kinda) legacy Vue2-JSX Project
I'm working on this somewhat legacy project that was build using Vue2's render(h){} function to render components, so it basically works as jsx, even though the components are .js. To complicate ...
0
votes
0
answers
105
views
Monorepo - sharing component between React and Preact app
I have a monorepo using pnpm which contains a React app (bundled with vite).
I have a new project where I want to keep the bundle low, so I thought of using Preact (vite).
The idea would be, in the ...
0
votes
0
answers
57
views
pnpm monorepo installed serval version of vite, it caused some typescript problem.it mismatching version of vite
Here is my problem,
I have a monorepo which use pnpm,inside this monorepo i have ./packages/appsA and /packages/appsB and /packages/appsC.
appsA installed [email protected], appsB installed [email protected].
inside ...
0
votes
1
answer
391
views
NX monorepo (@nrwl) can no find .svgr config file inside of lib directory
I am new to NX Monorepo with 2 separate react applications. need to have an icons lib to share between both of these apps.
I change the project.json of icons lib and add svg command like so:
{
"...
-1
votes
0
answers
43
views
avoiding barrel files in a typescript monorepo bundled with vite
Popular wisdom and guidance advise avoiding barrel files, but I am struggling to do so without using wild cards in tsconfig paths and package.json exports.
I have a monorepo that has a tsconfig-base....