markwoon / babel-plugin-transform-import-extension-es6-to-js

A Babel 6 plugin for transforming the extension of import files from .es6 to .js.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

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

For example:

import { foo } from 'foo.es6';

Becomes:

import { foo } from 'foo.js';

All this does is use resolveModuleSource:

babel.transform('code', {
  resolveModuleSource: function (source) {
    return source.replace('.es6', '.js');
  }
})

which unfortunately cannot be specified via babel-cli.

About

A Babel 6 plugin for transforming the extension of import files from .es6 to .js.


Languages

Language:JavaScript 100.0%