Skip to content

yangmingshan/babel-plugin-autocomplete-index

Repository files navigation

babel-plugin-autocomplete-index Actions Status

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
  ],
};

License

MIT

About

A babel plugin to add trailing index automatically

Resources

License

Stars

Watchers

Forks

Packages

No packages published