0.2.0 • Published 4 years ago
babel-plugin-autocomplete-index v0.2.0
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
],
};