🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

vue-cli-plugin-ali-oss

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vue-cli-plugin-ali-oss

upload ali oss for webpack or vue

1.0.3
latest
Source
npm
Version published
Maintainers
1
Created
Source

简介

  • 实现web项目打包后自动上传阿里云oss
  • 搭配自动tinypng图片压缩插件vue-tinypng-plugin效果更佳

使用说明

配置

1.创建 oss.js(优先级最高)

路径: {你的项目目录下}/oss.js

oss.js:

module.exports = {
	accessKeyId: "xxx",
	accessKeySecret: "xxx",
	bucket: "bucket",
	prefix: "prefix",
	projectName: true,
};

2.或者在插件初始化写入配置(优先级中)

  • 注意!!! 1.0.3版本之后需要包含在config里
new tinypngPlugin({
	config:{
		accessKeyId: "xxx",
		accessKeySecret: "xxx",
		bucket: "bucket",
		prefix: "prefix",
		projectName: true,
	}
})

引入

configureWebpack: (config) => {
    return {
        plugins: [
            new aliOssPlugin()
        ]
    }
}

路径顺序

https://${bucket}.${region}.aliyuncs.com/${prefix}/${projectName}/XXXX

配置属性

accessKeyId

阿里云accessKeyId

accessKeyId:XXX,

accessKeySecret

阿里云accessKeySecret

accessKeySecret:XXX,

bucket

bucket名称

bucket:XXX,

timeout

超时时间 默认:15 * 1000

timeout:XXX,

secure

是否https 默认:true

secure:XXX,

region

阿里oss-region 默认:"oss-cn-hangzhou"

region:XXX,

prefix

路径前缀名称

prefix:XXX,

projectName

是否使用项目名称在路径中 默认:true

projectName:XXX,

use

是否使用该插件 default: true

use: true/false,

reg

可识别的正则 默认: /.(png|jpe?g|bmp|gif|mp4|webm|mp3)/i

reg: XXXX

其他示例

vue-cli自动解析静态资源

Keywords

vue

FAQs

Package last updated on 05 Jun 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts