vite-plugin-deploy-oss 0.1.0 → 1.0.0

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.js CHANGED
@@ -60,6 +60,7 @@ function vitePluginDeployOss(option) {
60
60
  showProgress = true,
61
61
  ...props
62
62
  } = option || {};
63
+ let buildFailed = false;
63
64
  let upload = false;
64
65
  let outDir = "";
65
66
  const maxListeners = Math.max(20, concurrency * 3);
@@ -140,8 +141,11 @@ function vitePluginDeployOss(option) {
140
141
  name: "vite-plugin-deploy-oss",
141
142
  apply: "build",
142
143
  enforce: "post",
144
+ buildEnd(error) {
145
+ if (error) buildFailed = true;
146
+ },
143
147
  config(config) {
144
- if (!open) return;
148
+ if (!open || buildFailed) return;
145
149
  const validationErrors = validateOptions();
146
150
  if (validationErrors.length > 0) {
147
151
  console.log(`${import_chalk.default.red("\u2717 \u914D\u7F6E\u9519\u8BEF:")}
@@ -157,7 +161,7 @@ ${validationErrors.map((err) => ` - ${err}`).join("\n")}`);
157
161
  sequential: true,
158
162
  order: "post",
159
163
  async handler() {
160
- if (!open || !upload) return;
164
+ if (!open || !upload || buildFailed) return;
161
165
  console.log(`${import_chalk.default.blue("\u{1F680} \u5F00\u59CB\u4E0A\u4F20\u6587\u4EF6\u5230 OSS...")}
162
166
  `);
163
167
  const startTime = Date.now();
package/dist/index.mjs CHANGED
@@ -26,6 +26,7 @@ function vitePluginDeployOss(option) {
26
26
  showProgress = true,
27
27
  ...props
28
28
  } = option || {};
29
+ let buildFailed = false;
29
30
  let upload = false;
30
31
  let outDir = "";
31
32
  const maxListeners = Math.max(20, concurrency * 3);
@@ -106,8 +107,11 @@ function vitePluginDeployOss(option) {
106
107
  name: "vite-plugin-deploy-oss",
107
108
  apply: "build",
108
109
  enforce: "post",
110
+ buildEnd(error) {
111
+ if (error) buildFailed = true;
112
+ },
109
113
  config(config) {
110
- if (!open) return;
114
+ if (!open || buildFailed) return;
111
115
  const validationErrors = validateOptions();
112
116
  if (validationErrors.length > 0) {
113
117
  console.log(`${chalk.red("\u2717 \u914D\u7F6E\u9519\u8BEF:")}
@@ -123,7 +127,7 @@ ${validationErrors.map((err) => ` - ${err}`).join("\n")}`);
123
127
  sequential: true,
124
128
  order: "post",
125
129
  async handler() {
126
- if (!open || !upload) return;
130
+ if (!open || !upload || buildFailed) return;
127
131
  console.log(`${chalk.blue("\u{1F680} \u5F00\u59CB\u4E0A\u4F20\u6587\u4EF6\u5230 OSS...")}
128
132
  `);
129
133
  const startTime = Date.now();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vite-plugin-deploy-oss",
3
- "version": "0.1.0",
3
+ "version": "1.0.0",
4
4
  "main": "./dist/index.js",
5
5
  "module": "./dist/index.mjs",
6
6
  "types": "./dist/index.d.ts",