upload-assets-oss 0.0.1 → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +59 -9
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -1,16 +1,66 @@
|
|
|
1
|
-
#
|
|
1
|
+
# upload-assets-oss
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
将打包好的静态资源上传至对象存储服务,兼容vite与webpack。
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## feature
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
七牛云oss ✅
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
阿里云oss ❌
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
## 安装
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
```sh
|
|
14
|
+
npm install -D upload-assets-oss
|
|
15
15
|
|
|
16
|
-
|
|
16
|
+
or
|
|
17
|
+
|
|
18
|
+
yarn add -D upload-assets-oss
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## vite中使用
|
|
22
|
+
|
|
23
|
+
```js
|
|
24
|
+
import { vitePluginQiniu } from 'upload-assets-oss';
|
|
25
|
+
|
|
26
|
+
// https://vitejs.dev/config/
|
|
27
|
+
export default defineConfig({
|
|
28
|
+
plugins: [
|
|
29
|
+
vitePluginQiniu({
|
|
30
|
+
accessKey: '',
|
|
31
|
+
secretKey: '',
|
|
32
|
+
bucket: '',
|
|
33
|
+
forceDelete: true
|
|
34
|
+
}),
|
|
35
|
+
],
|
|
36
|
+
});
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## webpack中使用
|
|
40
|
+
|
|
41
|
+
```js
|
|
42
|
+
import { WebpackPluginQiniu } from 'upload-assets-oss';
|
|
43
|
+
|
|
44
|
+
// https://vitejs.dev/config/
|
|
45
|
+
module.exports = {
|
|
46
|
+
plugins: [
|
|
47
|
+
new WebpackPluginQiniu({
|
|
48
|
+
accessKey: '',
|
|
49
|
+
secretKey: '',
|
|
50
|
+
bucket: '',
|
|
51
|
+
forceDelete: true
|
|
52
|
+
}),
|
|
53
|
+
],
|
|
54
|
+
};
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
## Options
|
|
58
|
+
|
|
59
|
+
| Name | Type | Default| Required| Description |
|
|
60
|
+
| --- | --- | --- | --- | --- |
|
|
61
|
+
| accessKey | string | '' | true | 七牛 Access Key |
|
|
62
|
+
| secretKey | string | '' | true | 七牛 Secret Key |
|
|
63
|
+
| bucket | string | '' | true | 七牛 空间名 |
|
|
64
|
+
| forceDelete | boolean | false | false | 上传文件前,先强制删除之前上传七牛云上的文件 |
|
|
65
|
+
| rootName | string | '项目名称' | false | 文件上传的根目录名称 |
|
|
66
|
+
| isLog | boolean | false | false | 是否打印上传日志 |
|
package/package.json
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "upload-assets-oss",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.3",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"typings": "./dist/index.d.ts",
|
|
7
7
|
"repository": {
|
|
8
8
|
"type": "git",
|
|
9
|
-
"url": "https://github.com/jialongsu/
|
|
9
|
+
"url": "https://github.com/jialongsu/upload-assets-oss.git"
|
|
10
10
|
},
|
|
11
11
|
"bugs": {
|
|
12
|
-
"url": "https://github.com/jialongsu/
|
|
12
|
+
"url": "https://github.com/jialongsu/upload-assets-oss/issues"
|
|
13
13
|
},
|
|
14
|
-
"homepage": "https://github.com/jialongsu/
|
|
14
|
+
"homepage": "https://github.com/jialongsu/upload-assets-oss#readme",
|
|
15
15
|
"scripts": {
|
|
16
16
|
"dev": "yarn build -- --watch --ignore-watch examples",
|
|
17
17
|
"build": "tsup src/index.ts"
|