0.0.11 • Published 2 years ago

@aliyun-sls/babel-plugin-sls-import v0.0.11

Weekly downloads
-
License
MIT
Repository
-
Last release
2 years ago

介绍

用于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);
0.0.10

2 years ago

0.0.11

2 years ago

0.0.9

4 years ago

0.0.8

4 years ago

0.0.5

4 years ago

0.0.4

4 years ago

0.0.7

4 years ago

0.0.6

4 years ago

0.0.3

4 years ago

0.0.2

4 years ago

0.0.1

4 years ago