@travi/babel-preset
My shareable babel preset
Last updated a month ago by travi .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @travi/babel-preset 
SYNC missed versions from official npm registry.

babel-preset-travi

My shareable babel preset

Build Status

Usage

npm MIT license

Installation

$ npm install @travi/babel-preset --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 semantic-release PRs Welcome Renovate

Dependencies

$ nvm install
$ npm install

Verification

$ npm test

Current Tags

  • 2.1.0-beta.1                                ...           beta (2 years ago)
  • 3.0.30                                ...           latest (a month ago)

37 Versions

  • 3.0.30                                ...           a month ago
  • 3.0.29                                ...           a month ago
  • 3.0.28                                ...           a month ago
  • 3.0.27                                ...           2 months ago
  • 3.0.26                                ...           2 months ago
  • 3.0.25                                ...           3 months ago
  • 3.0.24                                ...           3 months ago
  • 3.0.23                                ...           3 months ago
  • 3.0.22                                ...           4 months ago
  • 3.0.21                                ...           4 months ago
  • 3.0.20                                ...           4 months ago
  • 3.0.19                                ...           5 months ago
  • 3.0.18                                ...           6 months ago
  • 3.0.17                                ...           6 months ago
  • 3.0.16                                ...           6 months ago
  • 3.0.15                                ...           6 months ago
  • 3.0.14                                ...           7 months ago
  • 3.0.13                                ...           7 months ago
  • 3.0.12                                ...           8 months ago
  • 3.0.11                                ...           8 months ago
  • 3.0.10                                ...           9 months ago
  • 3.0.9                                ...           10 months ago
  • 3.0.8                                ...           10 months ago
  • 3.0.7                                ...           10 months ago
  • 3.0.6                                ...           a year ago
  • 3.0.5                                ...           a year ago
  • 3.0.4                                ...           a year ago
  • 3.0.3                                ...           a year ago
  • 3.0.2                                ...           a year ago
  • 3.0.1                                ...           a year ago
  • 3.0.0                                ...           2 years ago
  • 2.1.0-beta.1                                ...           2 years ago
  • 2.1.0-beta                                ...           2 years ago
  • 2.0.0                                ...           2 years ago
  • 2.0.0-beta.2                                ...           2 years ago
  • 2.0.0-beta.1                                ...           2 years ago
  • 2.0.0-beta                                ...           2 years ago
Maintainers (1)
Downloads
Today 0
This Week 4
This Month 53
Last Day 4
Last Week 0
Last Month 75
Dependencies (1)
Dev Dependencies (14)
Dependents (1)

Copyright 2014 - 2016 © taobao.org |