babel-plugin-jsx-strip-ext

Strip .jsx extension from import sources

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
babel-plugin-jsx-strip-ext
1.0.17 years ago8 years agoMinified + gzip package size for babel-plugin-jsx-strip-ext in KB

Readme

babel-plugin-jsx-strip-ext Build Status Dependency Status
Strip .jsx extension from import sources.

Example

input.js
import Foo from './Foo.jsx'

.babelrc
{
  "presets": ["react", "es2015"],
  "plugins": ["jsx-strip-ext"]
}

output.js
'use strict';
var _Foo = require('./Foo');
var _Foo2 = _interopRequireDefault(_Foo);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

Usage

Via .babelrc (recommended)

{
  "plugins": ["jsx-strip-ext"]
}

Via Node API

require('babel-core').transform('code', {
  plugins: ['jsx-strip-ext']
})

js-standard-style