# @TimeCat/recorder

#### CDN [jsDelivr](https://www.jsdelivr.com/package/npm/@timecat/recorder)

#### More details to see 🏘️ [TimeCat Homepage](https://github.com/oct16/timecat#readme)

## Which dist file to use?

### From CDN or without a Bundler

- **`recorder.global(.prod).js`**:
  - For direct use via `<script src="...">` in the browser. Exposes the `Recorder` global.
  - Note that global builds are not [UMD](https://github.com/umdjs/umd) builds.  They are built as [IIFEs](https://developer.mozilla.org/en-US/docs/Glossary/IIFE) and is only meant for direct use via `<script src="...">`.
  - Contains hard-coded prod/dev branches, and the prod build is pre-minified. Use the `*.prod.js` files for production.

- **`recorder.esm(.prod).js`**:
  - For usage via native ES modules imports (in browser via `<script type="module">`.
  - Shares the same runtime compilation, dependency inlining and hard-coded prod/dev behavior with the global build.

### With a Bundler

- **`recorder.esm.js`**:
  - For use with bundlers like `webpack`, `rollup` and `parcel`.
  - Leaves prod/dev branches with `process.env.NODE_ENV` guards (must be replaced by bundler)
  - Does not ship minified builds (to be done together with the rest of the code after bundling)

### For Server-Side Rendering

- **`recorder.cjs(.prod).js`**:
  - For use in Node.js server-side rendering via `require()`.
  - If you bundle your app with webpack with `target: 'node'` this is the build that will be loaded.
  - The dev/prod files are pre-built, but the appropriate file is automatically required based on `process.env.NODE_ENV`.
