GithubHelp home page GithubHelp logo

yao-tools's Introduction

yao-tools

前端函数工具库模板

介绍

yao-tools 是一个工具库的模板

查看文档

yarn run docs

安装

// yarn
yarn add yao-tools -S

// npm
npm install yao-tools -S

通过<script>标签来直接使用

指定版本:

<script src="dist/yao-tools.min.js"></script>

ES 模块版本

<script src="dist/yao-tools.esm.browser.js"></script>

使用

js

import { isAndroid } from 'yao-tools'
const isDeviceAndroid = isAndroid()

打包

类型 文件名 功能
cjs yao-tools.cjs.js CommonJS,适用于 Node 和 Browserify/Webpack
umd yao-tools.umd.min.js 通用模块定义,以 amd,cjs 和 iife 为一体
esm yao-tools.esm.js 软件包保存为 ES 模块文件

依赖

Rollup

插件名 来源 说明
rollup-plugin-cleaner 社区 每次 build 前清除上一次的构建目录
rollup-plugin-terser 社区 采用 Terser 压缩 JavaScript
rollup-plugin-typescript2 社区 ts 转 js 的编译器
@rollup/plugin-replace 官方 自动替换文件中的环境变量
@rollup/plugin-node-resolve 官方 提供打包引入库的功能
@rollup/plugin-commonjs 官方 解决 rollup.js 无法识别 CommonJS 模块
@rollup/plugin-json 官方 提供导入 json 文件功能
@rollup/babel 官方 用于处理 es6 代码的转换,使转换出来的代码可以用于不支持 es6 的环境使用

Babel

依赖名 说明
@babel/core Babel 核心依赖
@babel/preset-env Babel 默认预设
@babel/runtime Babel helper 辅助函数依赖
@babel/runtime-corejs3 Babel polyfill 填充库
@babel/plugin-transform-runtime 对 Babel 各依赖联动管理

yao-tools's People

Contributors

yaoyao1987 avatar

Stargazers

Roman avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.