Typescript local dependencies (multiple projects)

I am new to typescript. I'm currently trying to create a project structure with dependencies with each other. There are three core projects, calculator and tax-calculator . The tax-calculator project needs code from the calculator project, which requires content from the core project. The core and calculator project must be a library, and the tax-calculator must be a web interface. The reason I am sharing the code is because I need core and calculator in other projects.

 core |--src |--MathUtils.ts |--... |--dist |--MathUtils.js calculator |--src |--Calculator.ts // needs MathUtils.ts |--dist |--Calculator.js tax-calculator |--src |--TaxCalculator.ts // needs Calculator.ts |--dist |--TaxCalculator.js 

How can I indicate that sources are available in other projects using npm or webpack ? I use VisualStudio Code, I want to use autocomplete and other functions in development, for example, when I use @types/chrome or other types.

+5
source share
1 answer

A bit late for the party, but I will provide various options for today, December 2018:

Customization using node / shell scripts, as in Cycle.js:

Configure JavaScript Monorepo .

Using Lerna:

Many large projects, including Babel, Marble.js, Material, Angular use Lerna to configure multiple packages

Links to script files:

TypeScript 3.0 now provides reference support for Project .

Also, if you use yarn, you can consider work areas, although I'm not sure how well it plays with TypeScript.

0
source

Source: https://habr.com/ru/post/1267116/


All Articles