Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

babel-preset-travi

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

babel-preset-travi

My shareable babel preset

  • 1.4.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

babel-preset-travi

My shareable babel preset

Build Status

Usage

npm MIT license

Installation

$ npm install babel-preset-travi --save-dev

Via .babelrc for internal development purposes

This will target the current version of node and transpile my preferred upcoming features.

{
  "presets": ["travi"]
}
In React projects

This will target the current node version, but will also transpile React features

{
  "presets": [["travi", {"react": true}]]
}

Via Rollup

  • Prevent transpilation of module imports/exports so Rollup can optimize properly
  • Transpile to the lowest common denominator of your expected consumers' execution environments

In the rollup.config.js:

export default {
  ...
  plugins: [
    babel({
      babelrc: false,
      exclude: ['./node_modules/**'],
      presets: [['travi', {targets: {node: 8}, modules: false}]],
    }),
    ...
  ],
  ...
};

In projects that target both node and browsers
export default {
  ...
  plugins: [
    babel({
      babelrc: false,
      exclude: ['./node_modules/**'],
      presets: [['travi', {targets: {node: 8, browser: true}, modules: false}]],
    }),
    ...
  ],
  ...
};

In React projects
export default {
  ...
  plugins: [
    babel({
      babelrc: false,
      exclude: ['./node_modules/**'],
      presets: [['travi', {
        targets: {node: 8, browser: true},
        react: true,
        modules: false
      }]],
    }),
    ...
  ],
  ...
};

Contribution

Conventional Commits Commitizen friendly Greenkeeper badge semantic-release PRs Welcome

Dependencies

$ nvm install
$ npm install

Verification

$ npm test

FAQs

Package last updated on 10 Nov 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc