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

@touchtribe/babel-presets

v0.1.4

Published

Default babel-presets for projects within Touchtribe

Downloads

94

Readme

@touchtribe/babel-presets

NPM version

Touchtribe’s company-wide set of Babel transforms.

Usage

Install this package, as well as the parts of Babel you wish to use:

With Yarn

yarn add @babel/core @touchtribe/babel-presets

With npm

npm install @babel/core @touchtribe/babel-presets

Then, in your Babel configuration , set this package as the babel preset you’d like to use:

{
  "babel": {
    "presets": ["@touchtribe/babel-presets/web"]
  }
}

Presets

@touchtribe/babel-presets

Default preset which includes:

{
  "presets": [
    [ "@babel/preset-env", {
      "useBuiltIns": "usage"
    }]
  ],
  "plugins": [
    "@babel/plugin-proposal-class-properties",
    "@babel/plugin-proposal-export-default-from",
    "@babel/plugin-proposal-export-namespace-from",
    "@babel/plugin-proposal-nullish-coalescing-operator",
    "@babel/plugin-proposal-optional-chaining",
    "@babel/plugin-syntax-dynamic-import"
  ]
}

Accepts the following options:

  • isDebug: Will set @babel/preset-env's debug option. Default: false
  • targets: Will set @babel/preset-env's targets option. Default: undefined
  • alias: Will set babel-plugin-module-resolver alias option. Default: undefined

Usage

{
  "presets": [
    ['@touchtribe/babel-presets', {
      // ["@babel/preset-env", {debug: isDebug || false }],
      "isDebug": true,
      
      // ["@babel/preset-env", {debug: isDebug || false }],
      "targets": [
        "> 1%"
      ],
      
      // ["babel-plugin-module-resolver", { alias: alias }] 
      "alias": {
        "app": "./src/app"
      }
    }]
  ]
}

@touchtribe/babel-presets/web

Preset for websites, includes @touchtribe/babel-presets with default targets

Accepts the following options:

  • isLegacy: Will set targets to default legacy-browsers
  • targets: Will set @babel/preset-env's targets option. Default: defaultTargets

defaultTargets

{
  "esmodules": false,
  "browsers" : [
    'last 2 Chrome versions',
    'not Chrome < 60',
    'last 2 Safari versions',
    'not Safari < 10.1',
    'last 2 iOS versions',
    'not iOS < 10.3',
    'last 2 Firefox versions',
    'not Firefox < 54',
    'last 2 Edge versions',
    'not Edge < 15'
  ]
}

legacyTargets

{
  "esmodules": false,
  "browsers": [
    '> 1%',
    'last 2 versions',
    'Firefox ESR'
  ]
}

Usage

{
  "presets": [
    ['@touchtribe/babel-presets/web', {
      "isLegacy": true
    }]
  ]
}

@touchtribe/babel-presets/node

Preset for websites, includes @touchtribe/babel-presets with default targets

Accepts the following options:

  • targets: Will set @babel/preset-env's targets option. Default: nodeTargets
  • modules: Will set @babel/preset-env's modules options. Default: false

nodeTargets

{
  node: 'current'
}

Usage

{
  "presets": [
    ['@touchtribe/babel-presets/node', {
      "modules": "cjs"
    }]
  ]
}

@touchtribe/babel-presets/react

Convenience preset for React. includes @babel/preset-react

  • debug is set to true when in development environment
{
  "presets": [
    ['@touchtribe/babel-presets/node'],
    ['@touchtribe/babel-presets/react']
  ]
}