Package json workspaces3/27/2023 ![]() ![]() package.json with the following content: -fix" This demo project will be named “SuzieQ”. This guide refers both to remote packages (located on the internet and probably developed by someone else than you) and local packages. It's a side note, but “packages” as used for a developer usually refers to packages downloaded from the internet by npm or yarn. and the tools of course, npm and tsc □ Package? Local packages? I recommend to set up a in the root of the monorepo, and reference that. Each local package has its own configuration, such as package.json, tsconfig.json and src-folder and other (but no node_modules). One folder per local package, located in the packages folder. The monorepo itself (the root folder with it's configuration files, like package.json, node_modules, tsconfig.json and other) Not covered by this guide: Building production builds - this guide is focused on the developer experience :) TL DR - Demo repo? from can reference local packages without errors. Running tsc in the monorepo root transpiles all packages in order. There will be just one node_modules folder (in the root of the monorepo).Įach piece (read: local package) of the product will have its own folder with its own package.json, tsconfig.json but use the monorepo's node_modules. Did you ever want to create one project, but with local packages? To be able to import local packages from other local packages? And the best part, to have a single node modules directory? To have a _single tsc to rebuild changed packages (but keep the others as-is)? And as a nice bonus, decrease both transpile and the time to start the program? The solution is to use a monorepo! This guide shows the step by step to manully setup a monorepo with NPM + TypeScript. ![]()
0 Comments
Leave a Reply.AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |