babel-plugin-import-from-index 1.7.1
Install from the command line:
Learn more about npm packages
$ npm install @talend/babel-plugin-import-from-index@1.7.1
Install via package.json:
"@talend/babel-plugin-import-from-index": "1.7.1"
About this version
This module is a babel plugin that transform default imports from specific file, into named imports from index.
Before
import React from 'react';
import { SidePanel } from '@talend/react-components';
import Actions, { ActionButton, ActionDropdown } from '@talend/react-components/lib/actions';
import List from '@talend/react-components/lib/List';After
import React from 'react';
import { SidePanel, Actions, ActionButton, ActionDropdown, List } from '@talend/react-components';Installation
npm i --dev @talend/babel-plugin-import-from-indexyarn add -D @talend/babel-plugin-import-from-indexConfiguration
// .babelrc.json
{
"plugins": ["@talend/babel-plugin-import-from-index"]
}