Socket
Socket
Sign inDemoInstall

ts-project-bundle

Package Overview
Dependencies
6
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    ts-project-bundle

A simple bundler for TypeScript projects using TypeScript project references.


Version published
Weekly downloads
315
decreased by-4.26%
Maintainers
1
Install size
427 kB
Created
Weekly downloads
 

Readme

Source

ts-project-bundle

A simple bundler for TypeScript projects using TypeScript project references.

This is a prototype! Please create an issue to give feedback.

Please seem my other repo for some examples TypeScript projects that demonstrate how to use project references.

Run it on your project

First install it:

npm install -g ts-project-bundle

Now navigate to your TypeScript project that uses TypeScript project references:

cd project-root/main-project

First compile your project and it's dependencies:

npx tsc --build

Note the use of the --build argument. This causes dependent projects to be built as well.

Now run ts-project-bundler against your main project:

ts-project-bundler --root=../ --project=./ --out=bundle

The root directory we are using is the parent directory of the main project. The root directory should contain the main project and all the libraries that the main project references.

The project directory is the main project directory. It is expected that this directory contains a tsconfig.json file that can be parsed to determine the referenced library projects.

The output directory is where to bundle the output. ts-project-bundle will copy tha main projects and the libraries it depends on to this otuput directory.

! Sorry this is a prototype and there's no graceful error handling yet. Please make sure your inputs are sane :-)

Build the test project

Clone this repo and then...

cd ts-project-bundle/test/test-project
npm install 
npx tsc --build
ts-project-bundle --root=../ --project=./ --out=../../out

Running it in development

Clone this repo and then...

cd ts-project-bundle
npm install
npm run start:dev

FAQs

Last updated on 20 Jul 2021

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc