@aliyun-sls/babel-plugin-sls-import
v0.0.11
Published
用于SLS App Frame加载公共组件的babel import plugin
Downloads
21
Readme
介绍
用于SLS App Frame加载公共组件的babel import plugin
本地开发
先执行yarn dev 再执行yarn test,可以看到test目录下文件的转换
样例
plugins: [
[
plugin,
{
slsLibrary: [
/^@aliyun-sls\S+/,
'someModuleName',
item => {
return item === 'anotherModuleName';
},
],
},
],
]
import { something, something2 } from 'module1';
import defaultThing from 'module2';
import { something as alias } from 'module3';
import { Button } from '@aliyun-sls/fusion';
import Dashboard from '@aliyun-sls/Dashboard';
<Dashboard></Dashboard>;
↓ ↓ ↓ ↓ ↓ ↓
import { something, something2 } from 'module1';
import defaultThing from 'module2';
import { something as alias } from 'module3';
const Button = _sls_import("@aliyun-sls/fusion").Button;
const Dashboard = _sls_import("@aliyun-sls/Dashboard");
/*#__PURE__*/
React.createElement(Dashboard, null);