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.
Files changed (2) hide show
  1. package/README.md +59 -9
  2. package/package.json +4 -4
package/README.md CHANGED
@@ -1,16 +1,66 @@
1
- # Vue 3 + TypeScript + Vite
1
+ # upload-assets-oss
2
2
 
3
- This template should help get you started developing with Vue 3 and TypeScript in Vite. The template uses Vue 3 `<script setup>` SFCs, check out the [script setup docs](https://v3.vuejs.org/api/sfc-script-setup.html#sfc-script-setup) to learn more.
3
+ 将打包好的静态资源上传至对象存储服务,兼容vite与webpack。
4
4
 
5
- ## Recommended IDE Setup
5
+ ## feature
6
6
 
7
- - [VS Code](https://code.visualstudio.com/) + [Volar](https://marketplace.visualstudio.com/items?itemName=Vue.volar)
7
+ 七牛云oss
8
8
 
9
- ## Type Support For `.vue` Imports in TS
9
+ 阿里云oss
10
10
 
11
- Since TypeScript cannot handle type information for `.vue` imports, they are shimmed to be a generic Vue component type by default. In most cases this is fine if you don't really care about component prop types outside of templates. However, if you wish to get actual prop types in `.vue` imports (for example to get props validation when using manual `h(...)` calls), you can enable Volar's Take Over mode by following these steps:
11
+ ## 安装
12
12
 
13
- 1. Run `Extensions: Show Built-in Extensions` from VS Code's command palette, look for `TypeScript and JavaScript Language Features`, then right click and select `Disable (Workspace)`. By default, Take Over mode will enable itself if the default TypeScript extension is disabled.
14
- 2. Reload the VS Code window by running `Developer: Reload Window` from the command palette.
13
+ ```sh
14
+ npm install -D upload-assets-oss
15
15
 
16
- You can learn more about Take Over mode [here](https://github.com/johnsoncodehk/volar/discussions/471).
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.1",
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/vite-plugin-qiniu.git"
9
+ "url": "https://github.com/jialongsu/upload-assets-oss.git"
10
10
  },
11
11
  "bugs": {
12
- "url": "https://github.com/jialongsu/vite-plugin-qiniu/issues"
12
+ "url": "https://github.com/jialongsu/upload-assets-oss/issues"
13
13
  },
14
- "homepage": "https://github.com/jialongsu/vite-plugin-qiniu#readme",
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"