babel-plugin-semantic-ui-react-transform-imports
v1.3.2
Published
Converts semantic-ui-react module imports to default imports and adds semantic-ui-less imports.
Downloads
13
Maintainers
Readme
babel-plugin-semantic-ui-react-transform-imports
Forked from babel-plugin-transform-semantic-ui-react-imports
This version supports Babel 7 by fixing a bug in index.js. The original one only supports up to Babel 6.
Thanks @tcrossland for contributing the bugfix
Function
This plugin can convert module imports from semantic-ui-react
to
default imports. Example:
// Input:
import { Button, Container } from 'semantic-ui-react';
// Output:
import Button from 'semantic-ui-react/dist/es/elements/Button/Button.js';
import Container from 'semantic-ui-react/dist/es/elements/Container/Container.js';
Installation
npm install babel-plugin-semantic-ui-react-transform-imports --save-dev
Depending on how you use the plugin, you also need to install semantic-ui-react, semantic-ui-css and/or semantic-ui-less (see below).
Usage
Add the plugin to your Babel configuration (e.g. in .babelrc):
{
"plugins": ["semantic-ui-react-transform-imports"]
}