babel-plugin-transform-import-extension-jsx-to-js

This Babel 6 plugin transforms the extension of imported files from .jsx to .js.

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
babel-plugin-transform-import-extension-jsx-to-js
000.1.07 years ago7 years agoMinified + gzip package size for babel-plugin-transform-import-extension-jsx-to-js in KB

Readme

babel-plugin-transform-import-extension-jsx-to-js
This Babel 6 plugin transforms the extension of imported files from .jsx to .js.
For example:
import { foo } from 'foo.jsx';

Becomes:
import { foo } from 'foo.js';

All this does is use resolveModuleSource:
babel.transform('code', {
  resolveModuleSource: function (source) {
    return source.replace('.jsx', '.js');
  }
})