babel-plugin-autocomplete-index
v0.2.0
Published
A babel plugin to add trailing index automatically
Downloads
12
Maintainers
Readme
babel-plugin-autocomplete-index
Sometimes you can't omit trailing index
, but luckily this babel plugin can do it for you.
In
// if './foo' is a directory
import foo from './foo';
require('./foo');
Out
import foo from './foo/index';
require('./foo/index');
This plugin will ignore non-relative path.
Installation
yarn add babel-plugin-autocomplete-index --dev
# OR
npm install babel-plugin-autocomplete-index --save-dev
Usage
babel.config.js
'use strict';
module.exports = {
plugins: [
'autocomplete-index',
// other plugins
],
};