open-index/open-npm huggingface dataset:
npm package: @sdlcforge/packjs
Description: Configures Babel and Rollup to support modern syntax and proposals in source code while producing optimized, backwards compatible output code.
Author: Zane Rockenbaugh
Latest version: 1.0.0-beta.2

# @sdlcforge/packjs

Configures Babel and Rollup to support modern syntax and proposals in source code while producing optimized, backwards compatible output code.

## Install

```bash
npm i @sdlcforge/packjs
```

## Running

```bash
npx rollup $(npm explore @sdlcforge/packjs -- pwd)/dist/rollup/rollup.config.mjs
```

## Usage

### Polyfills

Unfortunately, it is currently necessary to include necessary polyfills for target engines manually. This is the only way to get optimized output.

After extensive experimentation with different settings, it appears that Babel cannot really produce optimized polyfills. Even with 'usage' based configurations, it may include polyfills that are in fact not used and the polyfill logic also seems to ignore the `targets` setting (e.g., even when the target platform supports a function natively, Babel will still include the polyfill for it). See the [polyfill configuration notes in DEVELOPER_NOTES.md](./DEVELOPER_NOTES#polyfill-configuration-notes) for further details.