@ice/style-import
TypeScript icon, indicating that this package has built-in type declarations

1.1.0 • Public • Published

@ice/style-import

A transform function for automatic import style.

Usage

import transform from '@ice/style-import';

transform(`import { Button } from 'antd';
ReactDOM.render(<Button>xxxx</Button>);`, [{
  libraryName: 'antd',
  style: (importSpecifiers) =>
    importSpecifiers.map(specifier =>
      `import 'antd/es/${specifier}/style'`).join('\n'),
}]);

// the code will turn out as blew:
/* 
import { Button } from 'Button';
import 'antd/es/Button/style';
ReactDOM.render(<Button>xxxx</Button>); */

Readme

Keywords

none

Package Sidebar

Install

npm i @ice/style-import

Weekly Downloads

85

Version

1.1.0

License

MIT

Unpacked Size

9.81 kB

Total Files

6

Last publish

Collaborators

  • linbudu
  • answershuto
  • chenjun1011
  • luhengchang228
  • sobear
  • clarkxia
  • rax-publisher