All Projects → maiqingqiang → wepy-plugin-resources-cdn

maiqingqiang / wepy-plugin-resources-cdn

Licence: MIT license
上传图片到云存储wepy plugin

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to wepy-plugin-resources-cdn

Statically
⚡️ The best free and fast CDN for images, CSS, JavaScript, and open source.
Stars: ✭ 299 (+686.84%)
Mutual labels:  cdn, images
cdn
🚀 ✈️ 🚄 free CDN for everyone who wants to speed his website freely!😄
Stars: ✭ 16 (-57.89%)
Mutual labels:  cdn, images
Jquery.redirect
jQuery Redirect Plugin
Stars: ✭ 182 (+378.95%)
Mutual labels:  cdn
flex-originals
🎧 A video and audio streaming web application
Stars: ✭ 36 (-5.26%)
Mutual labels:  cdn
wechat-order
订餐小程序
Stars: ✭ 45 (+18.42%)
Mutual labels:  wepy
Greendns
A nonpoisonous and CDN-friendly Recursive DNS Resolver
Stars: ✭ 193 (+407.89%)
Mutual labels:  cdn
avif-sample-images
AVIF example images, licensed under CC-BY-SA.
Stars: ✭ 37 (-2.63%)
Mutual labels:  images
Peardownloader.js
一个支持多协议、多源、混合P2P-CDN的下载器
Stars: ✭ 170 (+347.37%)
Mutual labels:  cdn
oz-clear-unused-images-obsidian
Obsidian plugin to clear the images that are not used in note files anymore
Stars: ✭ 92 (+142.11%)
Mutual labels:  images
wx iciba
金山词霸(iciba)基于微信小程序wepy版本,可做wepy学习案例,
Stars: ✭ 29 (-23.68%)
Mutual labels:  wepy
nasa-images
product like nasa images gallery using react - redux
Stars: ✭ 17 (-55.26%)
Mutual labels:  images
Gofw
Chrome 扩展:麻麻再也不用担心 Google API 抽风了
Stars: ✭ 229 (+502.63%)
Mutual labels:  cdn
Rawgit
Served files from raw.githubusercontent.com, but with the correct content types. No longer actively developed.
Stars: ✭ 2,344 (+6068.42%)
Mutual labels:  cdn
GeoLite2-City
GeoLite2-City.mmdb.gz CDN files based on Free Open Source CDN jsDelivr!
Stars: ✭ 170 (+347.37%)
Mutual labels:  cdn
Cdn
CDN is a Just-in-time asset manipulation and delivery application, providing a complete content distribution/delivery solution
Stars: ✭ 192 (+405.26%)
Mutual labels:  cdn
qiniu-auto-cert
七牛 CDN 证书自动化工具
Stars: ✭ 20 (-47.37%)
Mutual labels:  cdn
Media Server
A brpc-based server to host and proxy live streams
Stars: ✭ 175 (+360.53%)
Mutual labels:  cdn
Newnode
NewNode decentralized Content Distribution Network
Stars: ✭ 223 (+486.84%)
Mutual labels:  cdn
gulp-upload-qcloud
腾讯云 cos 静态资源上传 gulp 插件
Stars: ✭ 18 (-52.63%)
Mutual labels:  cdn
wordpress-plugin
Speed up your WordPress website. Optimize your JPEG and PNG images automatically with TinyPNG.
Stars: ✭ 78 (+105.26%)
Mutual labels:  images

wepy-plugin-resources-cdn

npm npm

介绍

由于小程序代码包限制2M,经常会因为代码包超出2M而无法上传代码。一般都是因为图片等资源用得太多而导致包太大,因此我们会把图片放到服务器或CDN中,从而减少包体积。

为了方便把代码包中的图片上传到CDN中,本人开发了wepy-plugin-resources-cdn插件,在打包小程序时会自动把代码中用到的图片上传到指定的CDN中。

特性

  • 支持阿里云oss
  • 支持腾讯云cos
  • 支持又拍云
  • 支持七牛
  • 支持 AWS S3
  • 上传成功后,自动删除dist包中的图片,减少dist体积

注意

  • 暂时只支持wepy
  • 已经在公司项目用上,但是不保证完美,欢迎大家PR

安装

npm i wepy-plugin-resources-cdn --save-dev

配置wepy.config.js

module.exports.plugins = {
    'resources-cdn': {
          driver: 'oss',   //选择使用的云存储
          qiniu: {          //七牛配置
            accessKey: 'xxxxx',
            secretKey: 'xxxxx',
            bucket: 'xxxxx',
            domain: 'http://xxxxx.com'
          },
          upyun: {          //又拍云配置
            service: 'xxxxx',
            name: 'xxxxx',
            password: 'xxxxx',
            domain: 'http://xxxxx.net'
          },
          cos: {            //cos配置
            appId: 'xxxxx',
            secretId: 'xxxxx',
            secretKey: 'xxxxx',
            bucket: 'xxxxx',
            region: 'ap-guangzhou',
            https: true     //开启https
          },
          oss: {            //oss配置
            accessKeyId: 'xxxxx',
            accessKeySecret: 'xxxxx',
            bucket: 'xxxxx',
            region: 'oss-cn-shenzhen',
            secure: true    //开启https
          },
           s3: {            //s3配置
            accessKeyId: 'xxxxx',
            accessKeySecret: 'xxxxx',
            bucket: 'xxxxx',
            region: 'us-east-2',
            domain: 'xxxx'
          },
          config: {
            prefix: 'cdn-wxapp',  //上传前缀
            debugMode: true,      //开启debug
            time: true            //给图片url后面加上`?t=time()`防止重新打包后,因为缓存导致图片没变化
          }
        }
};

License MIT

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].