0.0.11 • Published 12 months ago

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

Weekly downloads
-
License
MIT
Repository
-
Last release
12 months 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

12 months ago

0.0.11

12 months ago

0.0.9

3 years ago

0.0.8

3 years ago

0.0.5

3 years ago

0.0.4

3 years ago

0.0.7

3 years ago

0.0.6

3 years ago

0.0.3

3 years ago

0.0.2

3 years ago

0.0.1

3 years ago