mirror of https://github.com/alibaba/ice.git
* test: improve test case * test: compat win32 * test: test case * test: add test case * test: add test case * test: test case for rax-compat * test: test case for routes * fix: types error * fix: to strict equal * chore: remove unused props * fix: types * test: test case for run client app * chore: remove empty router * test: test case of run server app * chore: remove log * chore: do not remove file by test case * fix: remove document dependency when run client app * chore: lint * chore: remove config * fix: lint * chore: lint warning * fix: test case * chore: update unplugin |
||
|---|---|---|
| .. | ||
| src | ||
| tests | ||
| CHANGELOG.md | ||
| README.md | ||
| package.json | ||
| tsconfig.json | ||
README.md
@ice/style-import
A transform function for automatic import style.
Usage
import transform from '@ice/style-import';
transfrom(`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>); */