npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

live-sdk

v1.1.17

Published

> 直播端的h5播放器

Readme

直播端的h5播放器

rollup参考资料

rollup插件库:https://github.com/rollup/awesome rollup-plugin-vue: https://rollup-plugin-vue.vuejs.org/options.html#style-trim

说明

编译之后格式为esm格式,支持import引入

import { Live } from '@akc/live-sdk'

项目需要引入

vant: ui axios: http请求 postcss-px-to-viewport: sdk源码单位尺寸为px,需要依赖项目进行px=>vw编译 vue-line-clamp: 处理文案省略号 @akc/ss-bullet-sdk: im通信

配置功能

模块懒加载: import { PreheatVideo } from '@akc/live-sdk' http封装: import CreateHttp from '@akc/http-sdk' class,async编译

httpAPi livingMeta 获取直播间初始化数据 => (sdk内 trusteeship 三方用户信息托管到直播 => (sdk内) pageQueryLiveList 直播频道接口 => 直播预告页面接口(sdk外,回调 batchQueryLiveListByActivities 饷店-批量查询活动关联的直播列表 => 直播播货(sdk外,回调 shareLive 分享功能 => (sdk内,另抛出回调 appointment 预约观看直播 => 直播预热 (sdk内,另抛出回调

// rollup.config.js import fs from 'fs'; import path from 'path'; import resolve from '@rollup/plugin-node-resolve' // 查找第三方依赖 import alias from '@rollup/plugin-alias'; // 定义别名 eg:@ import commonjs from '@rollup/plugin-commonjs'; // 将commonjs模块转化为es6 import replace from '@rollup/plugin-replace'; // 取代关键字 import babel, { getBabelOutputPlugin } from '@rollup/plugin-babel'; // 转化为es5 import { terser } from 'rollup-plugin-terser'; // iife格式,压缩代码 import cssOnly from 'rollup-plugin-css-only' import image from '@rollup/plugin-image'; // 图片转化为base64,但是图片路径资源有问题 // import strip from '@rollup/plugin-strip'; // 移除debugger/console/assert import vue from 'rollup-plugin-vue'; // 编译vue插件 import minimist from 'minimist'; import cleaner from 'rollup-plugin-cleaner'; // 清空cleaner // import postcss from 'rollup-plugin-postcss'

// Get browserslist config and remove ie from es build targets const esbrowserslist = fs.readFileSync('./.browserslistrc') .toString() .split('\n') .filter((entry) => entry && entry.substring(0, 2) !== 'ie');

const argv = minimist(process.argv.slice(2)); const projectRoot = path.resolve(__dirname, '..');

const baseConfig = { input: 'src/entry.js', plugins: { preVue: [ resolve({ extensions: ['.js', '.jsx', '.ts', '.tsx', '.vue'] }), alias({ resolve: ['.js', '.jsx', '.ts', '.tsx', '.vue'], entries: { '@': path.resolve(projectRoot, 'src'), }, }), image(), cssOnly(), // rollup-plugin-css-only // strip(), ], replace: { 'process.env.NODE_ENV': JSON.stringify('production'), 'process.env.ES_BUILD': JSON.stringify('false'), }, vue: { css: false, include: [/.vue$/i], defaultLang: { script: 'js' }, }, babel: { exclude: 'node_modules/**', extensions: ['.js', '.jsx', '.ts', '.tsx', '.vue'], babelHelpers: 'runtime', skipPreflightCheck: true, presets: [ [ '@babel/preset-env', { targets: esbrowserslist, }, ], ], }, }, };

// ESM/UMD/IIFE shared settings: externals // Refer to https://rollupjs.org/guide/en/#warning-treating-module-as-external-dependency const external = [ // list external dependencies, exactly the way it is written in the import statement. 'vue', 'vant', 'axios', '@akc/ss-bullet-sdk' ];

// UMD/IIFE shared settings: output.globals // Refer to https://rollupjs.org/guide/en#output-globals for details const globals = { // Provide global variable names to replace your external imports vue: 'Vue', vant: 'Vant', axios: 'axios', '@akc/ss-bullet-sdk': 'IM' };

// TODO: 只打包了es的模块格式 // Customize configs for individual targets const buildFormats = []; if (!argv.format || argv.format === 'es') { const esConfig = { ...baseConfig, external, output: { file: 'dist/index.js', format: 'esm', exports: 'named', plugins: [ getBabelOutputPlugin({ configFile: path.resolve(projectRoot, 'babel.config.js'), }) ] }, plugins: [ cleaner({ targets: [ 'dist' ] }), replace({ ...baseConfig.plugins.replace, 'process.env.ES_BUILD': JSON.stringify('true'), }), ...baseConfig.plugins.preVue, vue(baseConfig.plugins.vue), babel({ ...baseConfig.plugins.babel, }), commonjs(), ], }; buildFormats.push(esConfig); }

if (!argv.format || argv.format === 'cjs') { const umdConfig = { ...baseConfig, external, output: { compact: true, file: 'dist/index.ssr.js', format: 'cjs', name: 'AkcLiveSdk', exports: 'named', globals, }, plugins: [ replace(baseConfig.plugins.replace), ...baseConfig.plugins.preVue, vue({ ...baseConfig.plugins.vue, template: { ...baseConfig.plugins.vue.template, optimizeSSR: true, }, }), babel(baseConfig.plugins.babel), commonjs(), ], }; buildFormats.push(umdConfig); }

if (!argv.format || argv.format === 'iife') { const unpkgConfig = { ...baseConfig, external, output: { compact: true, file: 'dist/index.min.js', format: 'iife', name: 'AkcLiveSdk', exports: 'named', globals, }, plugins: [ replace(baseConfig.plugins.replace), ...baseConfig.plugins.preVue, vue(baseConfig.plugins.vue), babel(baseConfig.plugins.babel), commonjs(), terser({ output: { ecma: 5, }, }), ], }; buildFormats.push(unpkgConfig); }

// Export config export default buildFormats;