ms-vite-plugin 1.3.8 → 1.4.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.
@@ -37,6 +37,7 @@ exports.createStopGuardPlugin = createStopGuardPlugin;
37
37
  const acorn = __importStar(require("acorn"));
38
38
  const MagicString = require("magic-string");
39
39
  const STOP_GUARD_ERROR = "__kuaijs_stop_guard_error";
40
+ const STOP_GUARD_ERROR_TEXT = "__kuaijs_stop_guard_error_text";
40
41
  const STOP_EXCEPTION_NAME = "KuaiJSManualExitException";
41
42
  const STOP_RELATED_FUNCTION_ERROR = "is not a function";
42
43
  /**
@@ -124,9 +125,10 @@ function addCatchStopExceptionGuard(edits, catchClause, code) {
124
125
  text: `(${STOP_GUARD_ERROR})`,
125
126
  });
126
127
  }
127
- const stopGuard = `if(String(${errorExpression}).includes("${STOP_EXCEPTION_NAME}")||` +
128
- `String(${errorExpression}).includes("${STOP_RELATED_FUNCTION_ERROR}")){` +
129
- `console.error(${errorExpression});throw ${errorExpression};` +
128
+ const stopGuard = `const ${STOP_GUARD_ERROR_TEXT}=String(${errorExpression});` +
129
+ `if(${STOP_GUARD_ERROR_TEXT}.includes("${STOP_EXCEPTION_NAME}")||` +
130
+ `${STOP_GUARD_ERROR_TEXT}.includes("${STOP_RELATED_FUNCTION_ERROR}")){` +
131
+ `console.error(${STOP_GUARD_ERROR_TEXT});throw ${errorExpression};` +
130
132
  `}`;
131
133
  edits.push({
132
134
  start: catchClause.body.start + 1,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ms-vite-plugin",
3
- "version": "1.3.8",
3
+ "version": "1.4.0",
4
4
  "type": "commonjs",
5
5
  "license": "MIT",
6
6
  "publishConfig": {