@sdlcforge/packjs
v1.0.0-beta.0
Published
Configures Babel and Rollup to support modern syntax and proposals in source code while producing optimized, backwards compatible output code.
Readme
@sdlcforge/packjs
Configures Babel and Rollup to support modern syntax and proposals in source code while producing optimized, backwards compatible output code.
Install
npm i @sdlcforge/packjsRunning
npx rollup $(npm explore @sdlcforge/packjs -- pwd)/dist/rollup/rollup.config.mjsUsage
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 for further details.
