glyphix 1.0.36 → 1.0.37

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/bin/glyphix.js +8 -3
  2. package/package.json +1 -1
package/bin/glyphix.js CHANGED
@@ -126,17 +126,18 @@ var GxGenerate = class {
126
126
  // 正在构建的应用的 src 目录路径
127
127
  this.sourceRoot = (0, import_node_path3.resolve)(
128
128
  this.workspaceRoot,
129
- process.env["VITE_SOURCE_DIR"]
129
+ process.env["VITE_SOURCE_DIR"] ?? process.env["GLYPHIX_SOURCE_DIR"]
130
130
  );
131
131
  // 构建的 build 目录路径
132
132
  this.buildRoot = (0, import_node_path3.resolve)(
133
133
  this.workspaceRoot,
134
- process.env["VITE_BUILD_DIR"]
134
+ process.env["VITE_BUILD_DIR"] ?? process.env["GLYPHIX_BUILD_DIR"]
135
135
  );
136
136
  // gx 工具传递过来的入口文件,包括 app.{t,j}s 和各个页面的 js 文件路径
137
137
  this.entries = [];
138
+ const entryFile = process.env["GLYPHIX_BUILD_DIR"] ? ".node-entry.json" : "entry.vite.json";
138
139
  const content = JSON.parse(
139
- (0, import_node_fs.readFileSync)((0, import_node_path3.resolve)(this.buildRoot, "entry.vite.json")).toString()
140
+ (0, import_node_fs.readFileSync)((0, import_node_path3.resolve)(this.buildRoot, entryFile)).toString()
140
141
  );
141
142
  this.entries = content.entry.map(
142
143
  (item) => (0, import_node_path3.resolve)(this.buildRoot, item)
@@ -312,6 +313,10 @@ var GxGenerate = class {
312
313
  }
313
314
  };
314
315
  function generateGlyphix() {
316
+ console.log(
317
+ "process",
318
+ !process.env["VITE_BUILD_DIR"] || !process.env["VITE_SOURCE_DIR"]
319
+ );
315
320
  if ((!process.env["VITE_BUILD_DIR"] || !process.env["VITE_SOURCE_DIR"]) && (!process.env["GLYPHIX_BUILD_DIR"] || !process.env["GLYPHIX_SOURCE_DIR"]))
316
321
  throw Error("not set glyphix project path");
317
322
  const generate = new GxGenerate();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "glyphix",
3
- "version": "1.0.36",
3
+ "version": "1.0.37",
4
4
  "main": "lib/index.js",
5
5
  "types": "types/index.d.ts",
6
6
  "files": [