vite-plugin-deploy-oss 0.0.7 → 0.0.9
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/dist/index.d.mts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +3 -2
- package/dist/index.mjs +3 -2
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -54,6 +54,7 @@ function vitePluginDeployOss(option) {
|
|
|
54
54
|
autoDelete = false,
|
|
55
55
|
alias,
|
|
56
56
|
open = true,
|
|
57
|
+
isCache = false,
|
|
57
58
|
...props
|
|
58
59
|
} = option || {};
|
|
59
60
|
let upload = false;
|
|
@@ -88,14 +89,14 @@ function vitePluginDeployOss(option) {
|
|
|
88
89
|
});
|
|
89
90
|
for (const file of files) {
|
|
90
91
|
const filePath = (0, import_vite.normalizePath)(file);
|
|
91
|
-
const name = filePath.replace("dist", `${uploadDir}`).replace(
|
|
92
|
+
const name = filePath.replace("dist", `${uploadDir}`).replace(/\/\//g, "/");
|
|
92
93
|
try {
|
|
93
94
|
const result = await client.put(name, filePath, {
|
|
94
95
|
timeout: 6e5,
|
|
95
96
|
headers: {
|
|
96
97
|
"x-oss-storage-class": "Standard",
|
|
97
98
|
"x-oss-object-acl": "default",
|
|
98
|
-
"Cache-Control": "no-cache",
|
|
99
|
+
...isCache && { "Cache-Control": "no-cache" },
|
|
99
100
|
...overwrite && {
|
|
100
101
|
"x-oss-forbid-overwrite": "false"
|
|
101
102
|
}
|
package/dist/index.mjs
CHANGED
|
@@ -20,6 +20,7 @@ function vitePluginDeployOss(option) {
|
|
|
20
20
|
autoDelete = false,
|
|
21
21
|
alias,
|
|
22
22
|
open = true,
|
|
23
|
+
isCache = false,
|
|
23
24
|
...props
|
|
24
25
|
} = option || {};
|
|
25
26
|
let upload = false;
|
|
@@ -54,14 +55,14 @@ function vitePluginDeployOss(option) {
|
|
|
54
55
|
});
|
|
55
56
|
for (const file of files) {
|
|
56
57
|
const filePath = normalizePath(file);
|
|
57
|
-
const name = filePath.replace("dist", `${uploadDir}`).replace(
|
|
58
|
+
const name = filePath.replace("dist", `${uploadDir}`).replace(/\/\//g, "/");
|
|
58
59
|
try {
|
|
59
60
|
const result = await client.put(name, filePath, {
|
|
60
61
|
timeout: 6e5,
|
|
61
62
|
headers: {
|
|
62
63
|
"x-oss-storage-class": "Standard",
|
|
63
64
|
"x-oss-object-acl": "default",
|
|
64
|
-
"Cache-Control": "no-cache",
|
|
65
|
+
...isCache && { "Cache-Control": "no-cache" },
|
|
65
66
|
...overwrite && {
|
|
66
67
|
"x-oss-forbid-overwrite": "false"
|
|
67
68
|
}
|