TL;DR To run everything at once: yarn run start
This repository contains 3 modules:
-
npm-package- it contains a TS side effects free code that gets compiled to a format that could be used as ESM and CommonJS modules. To build the package:yarn run build -
common-js-module- it consumesnpm-packageas a CommonJS module. To build and execute the package:yarn run buildyarn run execNote that in the output bundle there are the
logFunctionsmodule and themultiplymethod even though they are not used in the code -
ts-tree-shaking-esm-module- it consumesnpm-packageas an ESM module. To build and execute the package:yarn run buildyarn run execNote that in the output bundle there's NO
logFunctionsmodule and themultiplymethod is marked as unused export thanks to tree shaking