@taole/tw-kit
v0.5.7
Published
twKit
Keywords
Readme
twKit
按需加载的轻量级的工具函数集,自带声明文件
使用方式
// 均为async方法
twKit.loadScript("someurl");
twKit.apiJsonp("someurl",{id:1});模块开发
- 参照
src/modules/api,需要建立api子目录,入口文件为index.ts - 模块中导出的方法,必须要以模块名为前缀(为了与其他模块导出的方法区分开)
使用方式
模块引入
import twKit from '@taole/tw-kit';cdn引入
<script src="https://asset.tuwan.com/script/tw-kit/0.3.11/cdn/index.js"></script>
<script>
// twKit.apiJsonp("someurl",{id:1});
</script>dev
本地开发, npm run dev 会启动demo项目,对应src/demo中的代码
发布
npm run build and npm publish
注意
发布之后, 要及时执行 npm run gen:cdn
因为twKit的子模块是放在cdn上的, 不会参与实际项目的打包构建, 所以新版本发布了之后要补全cdn
后续研究下怎么搞成自动的
