Skip to main content

All Questions

Tagged with
Filter by
Sorted by
Tagged with
10 votes
0 answers
1k views

create-react-app + gatsby packages in monorepo won't both run

I'm trying to create a monorepo with these packages: a web app created using create-react-app a gatsby site a library of components etc. that the web app and gatsby app will share (which is my main ...
toranpetto's user avatar
9 votes
1 answer
6k views

Nrwl / Nx - how to build single js file consumable by browser with dependencies bundled

I need to build a single js that can be used as Service Worker. I have a nrwl workspace with two @nrwl/web:lib packages, one is common and the other is worker. The worker package uses common through ...
František Žiačik's user avatar
8 votes
1 answer
2k views

webpack not bundling packages in monorepo (turborepo) then throws "unexpected token 'export'"

EDIT: Repository where issue can be reproduced easily: https://github.com/sebastiangug/turborepo-nestjs I have a turborepo project with several nestjs applications that share various packages. I've ...
SebastianG's user avatar
  • 9,217
8 votes
2 answers
3k views

How to configure Webpack to load a module from its src folder instead of dist?

I am working on a monorepo and therefore I want Webpack to load my sources from src instead of dist (dist is specified in package.json). For example given the following structure: /packages/core/...
Kai Sellgren's user avatar
  • 29.6k
7 votes
1 answer
1k views

Monorepos and cross package development. To use src/ or dist/?

My fellow yarn workspace typescript monorepo-nians, Question: When you are working within a monorepo are you able to import and use source code across packages or do you rely on the build steps ...
MichaelA58's user avatar
6 votes
2 answers
2k views

Webpack Cannot Resolve node_modules lazy assets

I'm working on a vuejs project and we're trying to use external vue cli applications as libraries. In these libraries we want to be able to export a router config, which lazy loads the components ...
Evan Burbidge's user avatar
6 votes
2 answers
2k views

What is a correct approach to a javascript monorepo

I'm trying to figure out correct approach for a javascript monorepo. Imagine monorepo containing packages / libraries: root - node_modules - packages + lib-a * node_modules +...
user3056783's user avatar
  • 2,536
6 votes
1 answer
2k views

Are Webpack 5 Module Federation micro frontends and Nx monorepos mutually exclusive?

I'm investigating micro frontend and monorepo architecture for an Angular 12 project. Webpack 5 recently became production ready and with it, Module Federation, Webpack's solution for micro frontends. ...
Kyle Vassella's user avatar
6 votes
0 answers
1k views

How to include 3rd party dependencies in Nx library

New to Nx and not sure yet when it makes sense to extract code into libraries... Is it possible/does it make sense to build an Nx library using a 3rd party dependency (let's say angular material) and ...
Patric's user avatar
  • 1,549
5 votes
1 answer
2k views

Force yarn to install certain modules to given workspace, rather than moving them to shared node_modules of monorepo?

I have a monorepo (via yarn workspaces). One of the workspaces is a React app created via Create React App (I think this is important, because CRA puts Webpack/Babel in its own node_modules). Another ...
jayarjo's user avatar
  • 16.6k
5 votes
1 answer
4k views

How to I get hot module reloading to work in a typescript monorepo

So I've been trying for the last few days completely in vain to get hot module reloading working in my Typescript/React/Koa/Mongo based monorepo; I feel like I've been banging my head against a brick ...
Ben Wainwright's user avatar
5 votes
1 answer
4k views

Monorepo with multiple '@/' path aliases - works in TypeScript but not Webpack compiler

I think this isn't possible, but worth an ask as I'm no webpack expert! We have a monorepo with lots of different workspace packages, using typescript, built using webpack. Each workspace has its own ...
Matt Bryson's user avatar
  • 2,784
5 votes
0 answers
597 views

How to let Webpack HMR work with Typescript monorepo on a npm workspace

I'm trying to determine how to switch our projects and libraries in a typescript monorepo using npm workspace. After some coding on a test structure I've been able to obtain an unsustifying working ...
Massimo's user avatar
  • 91
5 votes
0 answers
241 views

When using a babel.config.js as well as specifying options in webpack babel loader, would it merge both or ignore babel.config.js?

Hypothetically, if someone puts configuration of babel in three files at the same time: babel.config.js babel key in package.json babel loader options/query in webpack.config.js Then which one of ...
Rish's user avatar
  • 55
4 votes
0 answers
2k views

webpack 5 in a lerna monorepo loads files outside of the package

I have a fairly standard lerna monorepo setup, using yarn workspaces and TypeScript. There are pacakge folders for various services and also the React frontend. I've been migrating the Webpack config ...
S'unya Dickman's user avatar
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 ...
Guy's user avatar
  • 13.1k
4 votes
0 answers
898 views

Use babel, webpack, react in a mono repo setup without lerna or yarn

i'm trying to create a mono repo setup with webpack and babel to bundle multiple react apps that share some code. I would like to avoid lerna because of unnecessary overhead and unresolved problems ...
swen's user avatar
  • 41
4 votes
0 answers
854 views

Avoiding relative paths in sourcemaps that depend on other packages in a monorepo

When building packages in a monorepo using Lerna, how should webpack be configured to ensure that intra-monorepro, cross-package dependencies will emit sourcemaps that point to the installed location (...
Justin Grant's user avatar
3 votes
1 answer
4k views

Watch for changes in an npm link package being built with webpack

I have the following directory structure: application | |__ component-library | |__src | |__ app | |__src ...
dagda1's user avatar
  • 28.3k
3 votes
1 answer
1k views

"Unexpected token" error in babel-loader with inline loaders and require.context

In a basic CRA-app this works just fine: import MyMDX from '!babel-loader!mdx-loader!./mdx-file.mdx'; But when I try to do the same with require.context, like so: const mdxContext = require.context(...
o01's user avatar
  • 5,392
3 votes
0 answers
119 views

Share code between Angular and React with Yarn Workspaces does not work correctly

I have created a monorepo with yarn workspaces and initialized 3 packages: react-app angular-app shared (package.json name @monorepo/shared) angular-app and react-app include @monorepo/shared as a ...
Juliane Mohr's user avatar
3 votes
0 answers
469 views

NextJS - React-Native monorepo with react-native-elements

I'm trying to use react-native-elements in a react-native monorepo. It works fine in the Native App, but not in the NextJS Application. First, it compiles successfully: > with-react-native-web@ dev ...
ppressl's user avatar
  • 31
3 votes
0 answers
658 views

Webpack - how to determine which project is target for build in webpack

I am building new project based on Monorepo/NX(nrwl) and micro front-end architecture. I have extracted webpack config to build angular projects. there might be several angular projects and using nx ...
Alexander Gharibashvili's user avatar
3 votes
1 answer
3k views

configuring webpack in yarn workspaces

I am migrating some repos to a monorepo that uses yarn workspaces with Lerna. The packages look roughly like this: |-- packages |-- app |-- components-1 |-- components-2 app is bundled ...
Tyler's user avatar
  • 839
2 votes
1 answer
1k views

Cannot use TypeOrm in nx-nestjs project: ERR_REQUIRE_ESM

I am migrating my NestJS-TypeOrm app to a monorepo (NX workspace). Whenever I try to run the app, I get this error: C:\myproject\node_modules\@nrwl\node\src\executors\node\node-with-require-overrides....
Patric's user avatar
  • 1,549
2 votes
1 answer
762 views

I want my nx monorep to allow css and sass styling?

I created an nx workspace and added CSS for styling but my project also uses SCSS files. How can I tell my nx workspace to accept SCSS files? Is there a command I can run?
codythedev's user avatar
2 votes
1 answer
606 views

Configure aliases for webpack with lerna and typescript

I created a repository that shows the issue that I have: https://github.com/vileen/lerna-webpack-typescript-aliases-issue (it won't start the app properly for some reason but it doesn't matter). ...
Yourin's user avatar
  • 110
2 votes
1 answer
823 views

Monorepo: (NextJS 13 + Typescript) Module parse failed

I'm trying to move a currently working nextjs 13 app to a single monorepo. I basically created a new repo using npx create-turbo@latest and then moved my existing repo (lest call it "frontend&...
Marco's user avatar
  • 1,162
2 votes
0 answers
2k views

Micro Frontend configuration - nx nrwl monorepo

Configuration stack: Angular 13, Module Federation, Nx Monorepo, ngx-build-plus According to: Angular Enterprise book by Manfred Steyer Error: ChunkLoadError: Loading chunk default-...
profiler's user avatar
  • 607
2 votes
0 answers
2k views

How to include only specific module in webpack without transpiling its dependencies?

I'm working with a monorepo node.js project with the following structure: rootDir packageA packageB packageC I want to produce a bundle of packageB code using webpack and babel.js. packageA ...
Yos's user avatar
  • 1,346
2 votes
0 answers
345 views

monorepo with webpack (how to include assets in build)

I'm trying to create monorepo which will contain components that are built with typescript and sass. Folder structure looks like this: - packages - components - src - Slider ...
karaxuna's user avatar
  • 26.9k
1 vote
1 answer
76 views

AngularCompilerPlugin with multipe node_modules folders

I am working on a monorepository that houses multiple angular (v7) applications. Angular AOT compilation with webpack gives me trouble. The top-level structure looks like this: application 01 ...
David Brem's user avatar
1 vote
1 answer
790 views

Yarn workspaces - monorepo - react 17, react 18, nestjs, shared/common layer

I want to have a monorepo using yarn workspaces in which I hold: a react 17 app a react 18 app a nestjs app a shared layer with common functions for all of them (e.g: date format func) I cloned this ...
Cristian G's user avatar
1 vote
1 answer
1k views

Custom webpack config with next.js and next-fonts in a monorepo with @expo/vector-icons

I am trying to use solito to use a monorepo with React Native and Next.js. I successfully created a brand new project. My next step is to add a UI library called react-native-paper. Looks good so far ...
David Leuliette's user avatar
1 vote
1 answer
2k views

How do I configure a Nextjs project to transpile a monorepo project with next bundle analyzer?

I want to configure next js bundle analyzer with transpiling monorepo. I have a error message for loader. so I did this Stack overflow But It still has error. How do I configure a Nextjs project to ...
september21st's user avatar
1 vote
1 answer
241 views

Including bundled code from one project into another with Typescript support

I'm working on a project that has two subprojects: let's call them ProjectA and ProjectB. These are completely different projects, but both are written in Typescript and use webpack as bundler. ...
idjuradj's user avatar
  • 1,415
1 vote
0 answers
176 views

Webpack Not Resolving Tsconfig Paths in Subproject

I have a project which is a monorepo, using NPM workspaces and TS project references to separate the components. The frontend workspace is a Next.js app, and it imports some types and utilities from ...
LemongrabThree's user avatar
1 vote
0 answers
1k views

Storybook static build asset issue

I have an issue only when I generate the static bundle of my storybook I work with a monorepo (using nx) and I have a scss variable : $icon-path: "/assets/images"; I use this variable to ...
Shining's user avatar
  • 455
1 vote
0 answers
155 views

What are the differences between @nrwl/web:webpack and webpack?

I'm starting to configure my project using Nx and webpack. I can not understand the use of Nx executers at all. What is the benefit of using @nrwl/web:webpack instead of webpack? All I understand is ...
HesamSe's user avatar
  • 325
1 vote
0 answers
194 views

share react components and include with script tag instead package.json

I have 3 npm react projects: App1, App2, Shared. Usecase 1. In the moment I use npm with lerna and webpack5. App1 and App1 loads the bundle for Shared in package.json: "shared-components": &...
ahuegle's user avatar
  • 11
1 vote
0 answers
458 views

How does webpack handle different versions of the same dependency in a monorepo?

I created four fake monorepos with two packages each: Lerna v3 • Node.js 12.20 • Yarn 1.19.1 Package foo1 imports foo2 Both foo1 and foo2 use the same library (Ramda) Both foo1 and foo2 are bundled ...
customcommander's user avatar
1 vote
1 answer
1k views

In NPM workspaces Typescript fails to compile. In the rest of monorepository Typescript compiles correctly

We have refactored our project to be a mono repository (NPM Workspaces) and structure it like so: |-- apps |-- native <-- Not Workspace |-- web <-- Not ...
Alan Jereb's user avatar
1 vote
0 answers
258 views

Lerna react common lib "Support for the experimental syntax 'classProperties' isn't currently enabled" error

I'm trying to build a lerna monorepo with some create-react-app apps and a common lib. I'm following the script from that link Everything is going fine, I can access the monorepo common object ...
Mendes's user avatar
  • 18.2k
1 vote
1 answer
110 views

Wepback and front end monorepo

Researching a way to use Webpack with front end monorepo. I was wondering if I can use one common Webpack config and place it to the root directory and then extend this config in other apps. But, when ...
Vladyslav Tereshyn's user avatar
1 vote
1 answer
232 views

Webpack - How to reuse global library name when it already exists?

Good evening! I have this monorepo with multiple packages, where each of them is bundled independently using Webpack. Before it was a monorepo, I would have a single bundle file, and it would be ...
Apidcloud's user avatar
  • 3,878
1 vote
1 answer
903 views

Configuring Lerna for development environment: using shared package

I have monorepo built with Lerna. It has following structure: packages - create-react-app-example - utils create-react-app-example is like what create-react-app produces. I.e. it uses webpack ...
WelcomeTo's user avatar
  • 20.3k
0 votes
2 answers
523 views

Is more granular versioning in a monorepo with a container possible?

My team has a monorepo written with React, built with Webpack, and managed with Lerna. Currently, our monorepo contains a package for each screen in the app, plus a "container" package that ...
Donald T's user avatar
  • 10.5k
0 votes
2 answers
314 views

No metadata for "LookupType" was found. EntityMetadataNotFoundError: No metadata for "LookupType" was found

I am trying to create a backend using NestJS with nx mono repo and I am getting this error No metadata for "LookupType" was found. EntityMetadataNotFoundError: No metadata for "...
Ramazan Sağır's user avatar
0 votes
1 answer
3k views

Nx React - Assets can't be resolved

I'm working on a nx monorepo that has a few library and 2 apps. File Structures apps \--api \--funnel ( react with webpack ) \--api-e2e \--funnel-e2e libs \--funnel \----pages \--shared \----assets \--...
ADL's user avatar
  • 3
0 votes
1 answer
883 views

How to setup a simple serverless framework monorepo

I want to store all my services in a single repository in order to unify packaging and deployment process. Briefly, I want to hoist almost all dev dependencies to the root level of my repo: ...
Stepan Yudin's user avatar