@varlet/cli 1.23.4-alpha.2 → 1.23.4-alpha.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.
@@ -2,6 +2,10 @@ export declare const IMPORT_VUE_PATH_RE: RegExp;
2
2
  export declare const IMPORT_TS_PATH_RE: RegExp;
3
3
  export declare const IMPORT_JSX_PATH_RE: RegExp;
4
4
  export declare const IMPORT_TSX_PATH_RE: RegExp;
5
+ export declare const REQUIRE_VUE_PATH_RE: RegExp;
6
+ export declare const REQUIRE_TS_PATH_RE: RegExp;
7
+ export declare const REQUIRE_JSX_PATH_RE: RegExp;
8
+ export declare const REQUIRE_TSX_PATH_RE: RegExp;
5
9
  export declare const replaceVueExt: (script: string) => string;
6
10
  export declare const replaceTSExt: (script: string) => string;
7
11
  export declare const replaceJSXExt: (script: string) => string;
@@ -36,7 +36,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
36
36
  }
37
37
  };
38
38
  Object.defineProperty(exports, "__esModule", { value: true });
39
- exports.compileCommonJSEntry = exports.compileESEntry = exports.compileScriptFile = exports.compileScript = exports.replaceTSXExt = exports.replaceJSXExt = exports.replaceTSExt = exports.replaceVueExt = exports.IMPORT_TSX_PATH_RE = exports.IMPORT_JSX_PATH_RE = exports.IMPORT_TS_PATH_RE = exports.IMPORT_VUE_PATH_RE = void 0;
39
+ exports.compileCommonJSEntry = exports.compileESEntry = exports.compileScriptFile = exports.compileScript = exports.replaceTSXExt = exports.replaceJSXExt = exports.replaceTSExt = exports.replaceVueExt = exports.REQUIRE_TSX_PATH_RE = exports.REQUIRE_JSX_PATH_RE = exports.REQUIRE_TS_PATH_RE = exports.REQUIRE_VUE_PATH_RE = exports.IMPORT_TSX_PATH_RE = exports.IMPORT_JSX_PATH_RE = exports.IMPORT_TS_PATH_RE = exports.IMPORT_VUE_PATH_RE = void 0;
40
40
  var core_1 = require("@babel/core");
41
41
  var fsUtils_1 = require("../shared/fsUtils");
42
42
  var fs_extra_1 = require("fs-extra");
@@ -46,14 +46,26 @@ exports.IMPORT_VUE_PATH_RE = /((?<!['"`])import\s+.+from\s+['"]\s*\.{1,2}\/.+)\.
46
46
  exports.IMPORT_TS_PATH_RE = /((?<!['"`])import\s+.+from\s+['"]\s*\.{1,2}\/.+)\.ts(\s*['"`]);?(?!\s*['"`])/g;
47
47
  exports.IMPORT_JSX_PATH_RE = /((?<!['"`])import\s+.+from\s+['"]\s*\.{1,2}\/.+)\.jsx(\s*['"`]);?(?!\s*['"`])/g;
48
48
  exports.IMPORT_TSX_PATH_RE = /((?<!['"`])import\s+.+from\s+['"]\s*\.{1,2}\/.+)\.tsx(\s*['"`]);?(?!\s*['"`])/g;
49
+ exports.REQUIRE_VUE_PATH_RE = /(?<!['"`]\s*)(require\s*\(\s*['"]\s*\.{1,2}\/.+)\.vue(\s*['"`]\))(?!\s*['"`])/g;
50
+ exports.REQUIRE_TS_PATH_RE = /(?<!['"`]\s*)(require\s*\(\s*['"]\s*\.{1,2}\/.+)\.ts(\s*['"`]\))(?!\s*['"`])/g;
51
+ exports.REQUIRE_JSX_PATH_RE = /(?<!['"`]\s*)(require\s*\(\s*['"]\s*\.{1,2}\/.+)\.jsx(\s*['"`]\))(?!\s*['"`])/g;
52
+ exports.REQUIRE_TSX_PATH_RE = /(?<!['"`]\s*)(require\s*\(\s*['"]\s*\.{1,2}\/.+)\.tsx(\s*['"`]\))(?!\s*['"`])/g;
49
53
  var scriptReplacer = function (_, p1, p2) { return p1 + ".js" + p2; };
50
- var replaceVueExt = function (script) { return script.replace(exports.IMPORT_VUE_PATH_RE, scriptReplacer); };
54
+ var replaceVueExt = function (script) {
55
+ return script.replace(exports.IMPORT_VUE_PATH_RE, scriptReplacer).replace(exports.REQUIRE_VUE_PATH_RE, scriptReplacer);
56
+ };
51
57
  exports.replaceVueExt = replaceVueExt;
52
- var replaceTSExt = function (script) { return script.replace(exports.IMPORT_TS_PATH_RE, scriptReplacer); };
58
+ var replaceTSExt = function (script) {
59
+ return script.replace(exports.IMPORT_TS_PATH_RE, scriptReplacer).replace(exports.REQUIRE_TS_PATH_RE, scriptReplacer);
60
+ };
53
61
  exports.replaceTSExt = replaceTSExt;
54
- var replaceJSXExt = function (script) { return script.replace(exports.IMPORT_JSX_PATH_RE, scriptReplacer); };
62
+ var replaceJSXExt = function (script) {
63
+ return script.replace(exports.IMPORT_JSX_PATH_RE, scriptReplacer).replace(exports.REQUIRE_JSX_PATH_RE, scriptReplacer);
64
+ };
55
65
  exports.replaceJSXExt = replaceJSXExt;
56
- var replaceTSXExt = function (script) { return script.replace(exports.IMPORT_TSX_PATH_RE, scriptReplacer); };
66
+ var replaceTSXExt = function (script) {
67
+ return script.replace(exports.IMPORT_TSX_PATH_RE, scriptReplacer).replace(exports.REQUIRE_TSX_PATH_RE, scriptReplacer);
68
+ };
57
69
  exports.replaceTSXExt = replaceTSXExt;
58
70
  function compileScript(script, file) {
59
71
  return __awaiter(this, void 0, void 0, function () {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@varlet/cli",
3
- "version": "1.23.4-alpha.2+9c3ad084",
3
+ "version": "1.23.4-alpha.3+2b5b1bde",
4
4
  "description": "cli of varlet",
5
5
  "bin": {
6
6
  "varlet-cli": "./lib/index.js"
@@ -31,7 +31,7 @@
31
31
  "dev": "tsc --watch",
32
32
  "build": "tsc"
33
33
  },
34
- "gitHead": "9c3ad08410009e50b288f033b8fdbe10a8c01160",
34
+ "gitHead": "2b5b1bde5e1c16d4e58ce2a100ae4a1a3cc428ce",
35
35
  "dependencies": {
36
36
  "@babel/core": "^7.14.8",
37
37
  "@babel/preset-env": "^7.14.8",