npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@kensho-technologies/babel-preset

v22.0.0

Published

Babel preset to transpile ES2020/TS/JSX.

Downloads

191

Readme

babel-preset

Build Status npm

This Babel 7 preset transpiles ES2020, JSX, and selected language proposals. It also includes optimizations for specific contexts.

Install

$ npm install -D @kensho-technologies/babel-preset

Usage

You can set up Babel transpilation in several ways. Choose a method, and configure Babel to include the preset, e.g. in a babel.config.json:

{
  "presets": ["@kensho-technologies/babel-preset"]
}

Options

The preset can be configured using several options. Note that some options' defaults depend on the Babel environment, which may be one of the following:

| Environment | Purpose | | ------------- | -------------------------------------------------------------------- | | development | Transpiling an app for development. | | production | Transpiling an app for production. | | test | Transpiling an app or library to run in the current version of Node. | | cjs | Transpiling a library for distribution as CJS. | | esm | Transpiling a library for distribution as ESM. |

The present extends @babel/preset-env, and forwards all additional options to that preset.

emotion

false | options Default: false

Whether to enable support for CSS-in-JS via Emotion. If an options object is passed, it is forwarded to the Emotion plugin. This option requires an additional dependency on @emotion/react.

modules

false | 'commonjs' Default: 'commonjs' in test and cjs envs, false otherwise

Whether to compile ESM imports/exports to another module format.

// false:
import foo from './foo'

// 'commonjs' (roughly):
const foo = require('./foo')

react

false | options Default: {}

Whether to transpile JSX expressions. If an options object is passed, it is forwarded to the React preset.

reactRefresh

false | options Default: {} in development env if react is enabled

Whether to transform React function components for fast refresh. If an options object is passed, it is forwarded to the React Refresh plugin. The list of available options is not currently documented.

This option should only ever be enabled in development. It also requires bundler integration because the output code references global variables containing the Refresh runtime. If this integration cannot be added to a project's development environment, this option should be disabled.

runtime

true | false Default: true

Whether to enable the Babel runtime transform. This is encouraged to reduce bundle size, but requires adding @babel/runtime as a dependency.

targets

See @babel/preset-env options documentation. Default: current node version in test environment, inferred from browserslist config otherwise

The transpilation targets to pass to @babel/preset-env.

typescript

false | options Default: {}

Whether to enable TypeScript support. If an options object is passed, it's passed to the TypeScript preset.

License

Licensed under the Apache 2.0 License. Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2020-present Kensho Technologies, LLC. The present date is determined by the timestamp of the most recent commit in the repository.