3 Star 4 Fork 0

True / sdkset

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
MIT

sdkset logo

Version Downloads install size License

简介

简单易用,性能出色的前端工具库。使用menorepo组织项目结构,支持模块单独引入。

安装

强烈建议使用pnpm or yran安装(npm暂不支持workspace语法,)。

pnpm add @sdkset/<pluginName>
or
yran add @sdkset/<pluginName>

使用

类型支持

import type { List } from '@sdkset/types'

ES module

import * as sdk from '@sdkset/all'
or
import * as anyName from '@sdkset/<pluginName>'

CommonJS

const { ... } = require('@sdkset/all')
or
const { ... } = require('@sdkset/<pluginName>')

UMD

<!-- 引入插件,全局对象:sdk<PluginName> -->
<script src="https://cdn.jsdelivr.net/npm/@sdkset/<PlginName>"></script>

<!-- 注意,对于存在对等依赖的 UMD 插件方法,需提前引入对应依赖,示例: -->
<script src="https://cdn.jsdelivr.net/npm/@sdkset/mode"></script>
<script src="https://cdn.jsdelivr.net/npm/@sdkset/core"></script>
<script>
  sdkSocket.useWebSocket().then( ... )
</script>

babel

webpack

  1. 安装依赖
pnpm add babel-loader @babel/core @babel/preset-env @babel/plugin-transform-runtime @babel/runtime-corejs3 -D
  1. webapck 配置
// webpack.config.js
module.exports = {
  ...
  module: {
    rules: [
      {
        test: /\.(ts|js)x?$/,
        exclude: /node_modules/,
        loader: 'babel-loader'
      }
    ]
  }
}
  1. babel 配置
// babel.config.js
module.exports = {
  presets: [
    [
      '@babel/env',
      {
        targets: ['defaults', 'not IE 11']
      }
    ]
  ]
  plugins: [
    [
      '@babel/plugin-transform-runtime',
      {
        corejs: { version: 3, proposals: true }
      }
    ]
  ]
}

vite

  1. 安装依赖
pnpm add @vitejs/plugin-legacy terser -D
  1. vite 配置
// vite.config.js
import legacy from '@vitejs/plugin-legacy'

export default {
  plugins: [
    legacy({
      targets: ['defaults', 'not IE 11']
    })
  ]
}

相关项目

插件名称 插件简介 ES Module 支持 Common 支持 UMD 支持 全局对象
sdkset/all sdkset 插件集合
sdkset/types sdkset 类型声明
sdkset/core sdkset 工具插件集合 sdkCore
sdkset/mode mode 设计模式实现 sdkMode
sdkset/utils sdkset 函数库实现 sdkUtils

主要项目负责人

@True-Z

参与贡献方式

欢迎提交 PR 申请,经过审查后,贡献代码会及时进行合并。

开源协议

MIT @True-Z

The MIT License (MIT) Copyright (c) jiaozi Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

简介

简单易用,性能出色的前端工具库。 展开 收起
MIT
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
TypeScript
1
https://gitee.com/trueAlways/sdkset.git
git@gitee.com:trueAlways/sdkset.git
trueAlways
sdkset
sdkset
master

搜索帮助