All Projects → staven630 → webpack-oss

staven630 / webpack-oss

Licence: MIT license
webpack静态资源一键上传阿里云OSS插件,兼容webpack3.x/4.x

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to webpack-oss

guide
Maintenance Guidelines for GitHub/npm organization.
Stars: ✭ 12 (-58.62%)
Mutual labels:  oss
trace-cocoa-sdk
Catch bugs before they reach production — get detailed crash reports and monitor how your app is performing across the entire install base.
Stars: ✭ 15 (-48.28%)
Mutual labels:  oss
awesome-indoor-farming
A curated list of awesome dataset, technologies, companies, and media about Indoor Farming.
Stars: ✭ 52 (+79.31%)
Mutual labels:  oss
fossresponders.com
The website for FOSS Responders
Stars: ✭ 20 (-31.03%)
Mutual labels:  oss
elections-api
Serving JSON for all elections since 1992
Stars: ✭ 16 (-44.83%)
Mutual labels:  oss
mall4cloud
⭐️⭐️⭐️ Springcloud商城 O2O商城 小程序商城 PC商城 H5商城 APP商城 Java商城 分销商城 多用户商城 uniapp商城 微服务商城
Stars: ✭ 3,915 (+13400%)
Mutual labels:  oss
Go Fastdfs
go-fastdfs 是一个简单的分布式文件系统(私有云存储),具有无中心、高性能,高可靠,免维护等优点,支持断点续传,分块上传,小文件合并,自动同步,自动修复。Go-fastdfs is a simple distributed file system (private cloud storage), with no center, high performance, high reliability, maintenance free and other advantages, support breakpoint continuation, block upload, small file merge, automatic synchronization, automatic r…
Stars: ✭ 2,923 (+9979.31%)
Mutual labels:  oss
yii2-aliyun-oss
Yii2 Aliyun OSS Yii2 阿里云 OSS
Stars: ✭ 41 (+41.38%)
Mutual labels:  oss
grape-jwt-authentication
A reusable Grape JWT authentication concern
Stars: ✭ 31 (+6.9%)
Mutual labels:  oss
aliyun-oss-laravel
Laravel 的 Aliyun OSS 扩展, 支持 Laravel 9. Alibaba Cloud Object Storage Service For Laravel.
Stars: ✭ 91 (+213.79%)
Mutual labels:  oss
IconPacks.Browser
The Browser for all available Icon packages from MahApps.Metro.IconPacks
Stars: ✭ 74 (+155.17%)
Mutual labels:  oss
FactoryOrchestrator
A cross-platform system service which provides a simple way to run and manage factory line validation, developer inner-loop, diagnostics, and fault analysis workflows.
Stars: ✭ 36 (+24.14%)
Mutual labels:  oss
RuoYi-Vue-Plus
基于RuoYi-Vue集成 Lombok+Mybatis-Plus+Undertow+knife4j+Hutool+Feign 重写所有原生业务 定期与RuoYi-Vue同步
Stars: ✭ 110 (+279.31%)
Mutual labels:  oss
laravel-admin
LaravelAdmin是基于PHP开发的基础管理后台系统,做到开箱即用,为新项目开发省去了基础功能开发的步骤;此系统采用前后端分离模式,后端使用Laravel,前端使用vue;主要包含:登录、注销、可视化数据大屏、管理员、角色管理、菜单管理、权限管理、错误日志、登录日志、访问日志、获取服务器CPU使用率、内存使用率等功能。后端主要使用Artisan命令行、Jobs消息队列、 Rules验证规则、Restful API、Composer扩展包、Redis秒杀、Extend自定义扩展类:微信授权、钉钉告警推送、MongoDB、阿里云OSS、七牛云存储、七牛云直播、php-jwt TOKEN、Phpoffice、MySql数据库字典、Elasticsearch等技术。
Stars: ✭ 45 (+55.17%)
Mutual labels:  oss
android-oss-best-practices
Best practices on creating Android OSS library projects [JA]
Stars: ✭ 32 (+10.34%)
Mutual labels:  oss
ama
Ask Tanay questions about life, career, programming or anything. 🤔 He'll try his best to come up with a satisfactory answer.
Stars: ✭ 50 (+72.41%)
Mutual labels:  oss
spring-boot-learn-box
spring boot集成其他组件
Stars: ✭ 21 (-27.59%)
Mutual labels:  oss
next-oss
webpack打包文件上传到OSS
Stars: ✭ 18 (-37.93%)
Mutual labels:  oss
free-fs
✨Free-Fs 开源文件管理系统:基于 SpringBoot2.x + MyBatisPlus + MySQL + Shiro+ Layui 等搭配七牛云,阿里云OSS实现的云存储管理系统。包含文件上传、删除、预览、云资源列表查询、下载、文件移动、重命名、目录管理、登录、注册、以及权限控制等功能。
Stars: ✭ 49 (+68.97%)
Mutual labels:  oss
terraform-provider-graylog
Terraform Provider for Graylog
Stars: ✭ 21 (-27.59%)
Mutual labels:  oss

webpack-oss

webpack静态资源一键上传阿里云OSS插件,兼容webpack3.x/4.x

安装

npm i webpack-oss --save-dev

参数

选项名 类型 是否必填 默认值 描述
accessKeyId String 阿里云accessKeyId
accessKeySecret String 阿里云accessKeySecret
region String 阿里云region
bucket String 阿里云bucket
prefix String × '' 自定义路径前缀,通常使用项目目录名,文件将存放在alioss的bucket/prefix目录下
format Number × '' 可用时间戳来生成oss目录版本号,每次会保留最近的版本文件做零宕机发布,删除其他版本文件。可以通过插件自身提供的静态方法getFormat()获得
limit Number × 5 最多备份版本数量,会备份最近的版本,最小是3。配置了format才会生效
deleteAll Boolean × 是否删除bucket/prefix中所有文件。优先匹配format配置
local Boolean × false 默认每次上传webpack构建流中文件,设为true可上传打包后webpack output指向目录里的文件
output String × '' 读取本地目录的路径,如果local为true,output为空,默认为读取webpack输出目录
exclude ExpReg/Array × null 可传入正则,或正则组成的数组,来排除上传的文件

静态方法

static getFormat()

  参数又由YYYY|YY|MM|DD|HH|hh|mm|SS|ss组合而成,返回一个纯数字。 |

const WebpackAliOSSPlugin = require('webpack-oss')

WebpackAliOSSPlugin.getFormat()
WebpackAliOSSPlugin.getFormat('YYYY')

实例

  • 使用webpack构建流文件上传,并删原有所有资源
const WebpackAliOSSPlugin = require('webpack-oss')

new WebpackAliOSSPlugin({
  accessKeyId: '2****************9',
  accessKeySecret: 'z**************=',
  region: 'oss-cn-hangzhou',
  bucket: 'staven',
  prefix: 'nuxt-doc',   // "staven/nuxt-doc/icon_696aaa22.ttf"
  exclude: [/.*\.html$/], // 或者 /.*\.html$/,排除.html文件的上传  
  deleteAll: true	  // 优先匹配format配置项
})
  • 使用打包后的本地文件上传
const WebpackAliOSSPlugin = require('webpack-oss')
const path = require('path')

new WebpackAliOSSPlugin({
  accessKeyId: '2****************9',
  accessKeySecret: 'z**************=',
  region: 'oss-cn-hangzhou',
  bucket: 'staven',
  prefix: 'nuxt-doc',   // "staven/nuxt-doc/icon_696aaa22.ttf"
  exclude: [/.*\.html$/], // 或者 /.*\.html$/,排除.html文件的上传  
  local: true,
  output: path.resolve(__dirname, './build') // 此项不填,将默认指向webpack/vue-cli等工具输出目录
})
  • 使用format做版本备份
const WebpackAliOSSPlugin = require('webpack-oss')
const time = WebpackAliOSSPlugin.getFormat('YYMMDD')

new WebpackAliOSSPlugin({
  accessKeyId: '2****************9',
  accessKeySecret: 'z**************=',
  region: 'oss-cn-hangzhou',
  bucket: 'staven',
  prefix: 'nuxt-doc',   // "staven/nuxt-doc/icon_696aaa22.ttf"
  exclude: [/.*\.html$/], // 或者 /.*\.html$/,排除.html文件的上传  
  deleteAll: false,	  // 优先匹配format配置项
  format: time, // 备份最近版本的oss文件,删除其他版本文件
  local: true,   // 上传打包输出目录里的文件
  limit: 10  // 备份版本数量,其余版本被删除
})
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].