Babel preset with optimizations in mind, modern output
npm install babel-preset-optimise> Babel preset with optimizations in mind, modern output
Please consider following this project's author,
Charlike Mike Reagent, and :star: the project
to show your :heart: and support.
[![Code style][codestyle-img]][codestyle-url]
[![CircleCI linux build][linuxbuild-img]][linuxbuild-url]
[![CodeCov coverage status][codecoverage-img]][codecoverage-url]
[![Renovate App Status][renovateapp-img]][renovateapp-url]
[![Make A Pull Request][prs-welcome-img]][prs-welcome-url]
[![Time Since Last Commit][last-commit-img]][last-commit-url]
If you have any _how-to_ kind of questions, please read the [Contributing
Guide][contributing-url] and [Code of Conduct][code_of_conduct-url] documents.
For bugs reports and feature requests, [please create an issue][open-issue-url]
or ping @tunnckoCore at Twitter.
[![Conventional Commits][ccommits-img]][ccommits-url]
[![Minimum Required Nodejs][nodejs-img]][npmv-url]
[![NPM Downloads Monthly][downloads-monthly-img]][npmv-url]
[![NPM Downloads Total][downloads-total-img]][npmv-url]
[![Share Love Tweet][twitter-share-img]][twitter-share-url]
[![Twitter][twitter-img]][twitter-url]
Project is semantically versioned & automatically released
from GitHub Actions with
Lerna.
[![Become a Patron][patreon-img]][patreon-url]
[![Buy me a Kofi][kofi-img]][kofi-url]
[![PayPal Donation][paypal-img]][paypal-url]
[![Bitcoin Coinbase][bitcoin-img]][bitcoin-url]
[![Keybase PGP][keybase-img]][keybase-url]
| Topic | Contact |
| :--------------------------------------------------------------- | ------------------------------------------------: |
| Any legal or licensing questions, like private or commerical use | ![tunnckocore_legal][tunnckocore_legal] |
| For any critical problems and security reports | ![tunnckocore_security][tunnckocore_security] |
| Consulting, professional support, personal or team training | ![tunnckocore_consulting][tunnckocore_consulting] |
| For any questions about Open Source, partnerships and sponsoring | ![tunnckocore_opensource][tunnckocore_opensource] |
- Install
- Usage
- What it includes?
- API
- babelPresetOptimize
- Signature
- Params
- Contributing
- Guides and Community
- Support the project
- Contributors
- License
_(TOC generated by verb using
markdown-toc)_
This project requires Node.js >=10.13 _(see
Support & Release Policy)_.
Install it using yarn or
npm.
_We highly recommend to use Yarn when you
think to contribute to this project._
``bash`
$ yarn add babel-preset-optimise
`js`
module.exports = {
presets: ['babel-preset-optimise'],
};
_Note: initially it was meant to be called babel-preset-optimize, but the
package was squatted before I get able to push all this things. Born in
discussion with @JounQin in
1stG/configs issue#8._
It uses the most recent and modern preset by the Babel Team -
@babel/preset-modules, plus
optionally the TypeScript and the React presets. It also includes a several
optimization plugins from the Babel Minify project which are very well curated
for best and small output.
_Generated using jest-runner-docs._
Be aware that when you use minifyBuiltins: true you _MAY_ get a bigger output,
but that's not always guaranteed, just try for your case.
If you want to use JSX (React) pass options.jsx: true. If you want to use JSX{ jsx: true, typescript: true }
(React) + TypeScript pass both . If you wan to{ jsx: { pragma: 'h' }, typescript: true }
use Preact + TypeScript, , ifoptions.jsx is an object, it is directly passed to preset-react.
#### Signature
`ts`
function(api, options)
#### Params
- options {object} - optionally control what can be includedoptions.jsx
- {boolean} - default false, pass true if you wantreact
; pass an object for more customization (passed to react preset)options.commonjs
- {boolean} - default false, pass non-falsey value tooptions.typescript
transform ESModules to CommonJS
- {boolean} - default false, includes the TypeScriptoptions.development
preset
- {boolean} - default false, disables few plugins;true
when it is and options.jsx is enabled (true or object) we addoptions.jsx.development: true
toooptions.minifyBuiltins
- {boolean} - default false, includes
[babel-plugin-minify-builtins][]
Please read the [Contributing Guide][contributing-url] and [Code of
Conduct][code_of_conduct-url] documents for advices.
For bug reports and feature requests, please join our [community][community-url]
forum and open a thread there with prefixing the title of the thread with the
name of the project if there's no separate channel for it.
Consider reading the
Support and Release Policy
guide if you are interested in what are the supported Node.js versions and how
we proceed. In short, we support latest two even-numbered Node.js release lines.
[Become a Partner or Sponsor?][kofi-url] :dollar: Check the OpenSource
Commision (tier). :tada: You can get your company logo, link & name on this
file. It's also rendered on package's page in [npmjs.com][npmv-url] and
yarnpkg.com sites too!
:rocket:
Not financial support? Okey!
Pull requests,
stars and all kind of
contributions
are always welcome. :sparkles:
This project follows the
all-contributors
specification. Contributions of any kind are welcome!
Thanks goes to these wonderful people
(emoji key), consider showing
your support to them:
Charlike Mike Reagent 🚇 💻 📖 🤔 🚧 ⚠️ |
Copyright (c) 2020-present, Charlike Mike Reagent
Released under the [MPL-2.0 License][license-url].
[contributing-url]: https://github.com/tunnckoCore/opensource/blob/master/CONTRIBUTING.md
[code_of_conduct-url]: https://github.com/tunnckoCore/opensource/blob/master/CODE_OF_CONDUCT.md
[npmv-url]: https://www.npmjs.com/package/babel-preset-optimise
[npmv-img]: https://badgen.net/npm/v/babel-preset-optimise?icon=npm&cache=300
[license-url]: https://github.com/tunnckoCore/opensource/blob/master/packages/babel-preset-optimise/LICENSE
[license-img]: https://badgen.net/npm/license/babel-preset-optimise?cache=300
[libera-manifesto-url]: https://liberamanifesto.com
[libera-manifesto-img]: https://badgen.net/badge/libera/manifesto/grey
[codecoverage-img]: https://badgen.net/badge/coverage/98.61%25/99CC09?icon=codecov&cache=300
[codecoverage-url]: https://codecov.io/gh/tunnckoCore/opensource
[codestyle-url]: https://github.com/airbnb/javascript
[codestyle-img]: https://badgen.net/badge/code%20style/airbnb/ff5a5f?icon=airbnb&cache=300
[linuxbuild-url]: https://github.com/tunnckocore/opensource/actions
[linuxbuild-img]: https://badgen.net/github/checks/tunnckoCore/opensource/master?cache=300&label=build&icon=github
[ccommits-url]: https://conventionalcommits.org/
[ccommits-img]: https://badgen.net/badge/conventional%20commits/v1.0.0/green?cache=300
[standard-release-url]: https://github.com/standard-release/standard-release
[standard-release-img]: https://badgen.net/badge/semantically/released/05c5ff?cache=300
[community-img]: https://badgen.net/badge/join/community/7b16ff?cache=300
[community-url]: https://github.com/tunnckocorehq/community
[last-commit-img]: https://badgen.net/github/last-commit/tunnckoCore/opensource/master?cache=300
[last-commit-url]: https://github.com/tunnckoCore/opensource/commits/master
[nodejs-img]: https://badgen.net/badge/node/>=10.13/green?cache=300
[downloads-weekly-img]: https://badgen.net/npm/dw/babel-preset-optimise?icon=npm&cache=300
[downloads-monthly-img]: https://badgen.net/npm/dm/babel-preset-optimise?icon=npm&cache=300
[downloads-total-img]: https://badgen.net/npm/dt/babel-preset-optimise?icon=npm&cache=300
[renovateapp-url]: https://renovatebot.com
[renovateapp-img]: https://badgen.net/badge/renovate/enabled/green?cache=300
[prs-welcome-img]: https://badgen.net/badge/PRs/welcome/green?cache=300
[prs-welcome-url]: http://makeapullrequest.com
[paypal-url]: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=HYJJEZNSGAPGC&source=url
[paypal-img]: https://badgen.net/badge/PayPal/donate/003087?cache=300&icon=https://simpleicons.now.sh/paypal/fff
[kofi-url]: https://ko-fi.com/tunnckoCore
[kofi-img]: https://badgen.net/badge/Buy%20me/a%20coffee/29abe0c2?cache=300&icon=https://rawcdn.githack.com/tunnckoCore/badgen-icons/f8264c6414e0bec449dd86f2241d50a9b89a1203/icons/kofi.svg
[bitcoin-url]: https://www.blockchain.com/btc/payment_request?address=3QNHKun1K1SUui1b4Z3KEGPPsWC1TgtnqA&message=Open+Source+Software&amount_local=10¤cy=USD
[bitcoin-img]: https://badgen.net/badge/Bitcoin%20tip/3QNHKun...b4Z3KEGPPsWC1TgtnqA/yellow?cache=300&icon=https://simpleicons.now.sh/bitcoin/fff
[keybase-url]: https://keybase.io/tunnckoCore
[keybase-img]: https://badgen.net/keybase/pgp/tunnckoCore?cache=300
[twitter-url]: https://twitter.com/tunnckoCore
[twitter-img]: https://badgen.net/twitter/follow/tunnckoCore?icon=twitter&color=1da1f2&cache=300
[patreon-url]: https://www.patreon.com/bePatron?u=5579781
[patreon-img]: https://badgen.net/badge/Become/a%20patron/F96854?icon=patreon
[patreon-sponsor-img]: https://badgen.net/badge/become/a%20sponsor/F96854?icon=patreon
[twitter-share-url]: https://twitter.com/intent/tweet?text=https://ghub.now.sh/babel-preset-optimise&via=tunnckoCore
[twitter-share-img]: https://badgen.net/badge/twitter/share/1da1f2?icon=twitter
[open-issue-url]: https://github.com/tunnckoCore/opensource/issues/new
[tunnckocore_legal]: https://badgen.net/https/liam-badge-daknys6gadky.runkit.sh/com/legal/tunnckocore?label&color=A56016&icon=https://svgshare.com/i/Dt6.svg
[tunnckocore_consulting]: https://badgen.net/https/liam-badge-daknys6gadky.runkit.sh/com/consulting/tunnckocore?label&color=07ba96&icon=https://svgshare.com/i/Dt6.svg
[tunnckocore_security]: https://badgen.net/https/liam-badge-daknys6gadky.runkit.sh/com/security/tunnckocore?label&color=ed1848&icon=https://svgshare.com/i/Dt6.svg
[tunnckocore_opensource]: https://badgen.net/https/liam-badge-daknys6gadky.runkit.sh/com/opensource/tunnckocore?label&color=ff7a2f&icon=https://svgshare.com/i/Dt6.svg
[tunnckocore_newsletter]: https://badgen.net/https/liam-badge-daknys6gadky.runkit.sh/com/newsletter/tunnckocore?label&color=5199FF&icon=https://svgshare.com/i/Dt6.svg
[babel-plugin-minify-builtins]: https://github.com/babel/minify