Skip to content

Latest commit

 

History

History
47 lines (32 loc) · 1.56 KB

README.md

File metadata and controls

47 lines (32 loc) · 1.56 KB

!!! DISCLAIMER !!!

To anyone who might stumble upon this by chance in hopes of a usable template:

The code in this repo doesn't produce any satisfying / usable output yet. The ESM path is still mostly broken and anything that works is currently only tested against node.

ts-cjs-esm-package

Demonstrate building an NPM Package that ships both module formats (CJS / ESM) from a TypeScript Codebase


Repository structure

This repo utilizes npm workspaces. to run any npm script in one of the workspaces from the root dir use:

npm run <script name> --workspace=<workspace / package name>

Prequisites

Take a look into the root package.json's engine field to see what runtime the code is targeting.

Getting started

> npm i
> npm run build
# make sure to build all packages and applications before attempting to start anything

Running the Node Versions

> npm run start

Running the Browser Version

> npm run start:browser