Gathering detailed insights and metrics for xb-aliyunoss-webpack-plugin
Gathering detailed insights and metrics for xb-aliyunoss-webpack-plugin
Gathering detailed insights and metrics for xb-aliyunoss-webpack-plugin
Gathering detailed insights and metrics for xb-aliyunoss-webpack-plugin
npm install xb-aliyunoss-webpack-plugin
Typescript
Module System
Node Version
NPM Version
JavaScript (100%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
20 Commits
1 Watchers
1 Branches
1 Contributors
Updated on Mar 16, 2018
Latest Version
1.0.1
Package Id
xb-aliyunoss-webpack-plugin@1.0.1
Unpacked Size
9.43 kB
Size
4.07 kB
File Count
6
NPM Version
5.5.1
Node Version
8.9.3
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
webpack的插件,用于自动上传静态资源到阿里的oss上,以便作为静态资源使用,当然你也可以用于自动存储大文件。
本插件基于aliyunoss-webpack-plugin, 在原版上修改了目录文件读取方式,由此可递归获取目标目录下的所有文件。
Install the plugin with npm:
1$ npm install xb-aliyunoss-webpack-plugin --save-dev
add the plugin to your webpack config as follows:
1var AliyunossWebpackPlugin = require('aliyunoss-webpack-plugin') 2var webpackConfig = { 3 entry: 'index.js', 4 output: { 5 path: 'dist', 6 filename: 'index_bundle.js' 7 }, 8 plugins: [new AliyunossWebpackPlugin({ 9 buildPath:'your build path', 10 region: 'your region', 11 accessKeyId: 'your key', 12 accessKeySecret: 'your secret', 13 bucket: 'your bucket', 14 getObjectHeaders: function(filename) { 15 return { 16 Expires: 6000 17 } 18 } 19 })] 20}
don't depend webpack,just as follows:
1var AliyunossWebpackPlugin = require('aliyunoss-webpack-plugin') 2var oss = new AliyunossWebpackPlugin({ 3 buildPath:'your build path', 4 region: 'your region', 5 accessKeyId: 'your key', 6 accessKeySecret: 'your secret', 7 bucket: 'your bucket', 8 deleteAll: true, 9 generateObjectPath: function(filename, file) { 10 return filename 11 }, 12 getObjectHeaders: function(filename) { 13 return { 14 Expires: 6000 15 } 16 } 17}); 18oss.apply()
The plugin allowed values are as follows:
buildPath
: 需要上传的文件路径,支持整个文件夹的递归遍历。支持node-glob风格路径,具体可以参见node-glob的文档。region
: oss的区域,如:oss-cn-shanghai。accessKeyId
: 阿里云的权限访问的key。accessKeySecret
: 阿里云的权限访问的secret。bucket
: 阿里云OSS上的命名空间。deleteAll
: 先删除oss上的代码之后再上传,默认为falsegenerateObjectPath
: 函数(可选),函数参数为上传的文件名,必须返回一个字符串作为文件名,默认为文件原名。通过该函数可以让使用者自定义上传的文件名或者修改oss的路径,比如加一个前缀等getObjectHeaders
: 函数(可选),函数参数为上传的文件名,返回设置的headers对象,默认为空,具体可以参见ali-oss的文档internal
: 使用内网还是外网(可选),默认外网No vulnerabilities found.
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
Reason
no SAST tool detected
Details
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
Found 0/20 approved changesets -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Score
Last Scanned on 2025-07-07
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More