@gxp-dev/tools 2.0.49 → 2.0.51
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.
|
@@ -12,9 +12,23 @@ const { exportCmd } = require("../constants");
|
|
|
12
12
|
const { findProjectRoot, resolveGxPaths } = require("../utils");
|
|
13
13
|
|
|
14
14
|
/**
|
|
15
|
-
* Get the plugin name from package.json
|
|
15
|
+
* Get the plugin name from app-manifest.json (preferred) or package.json
|
|
16
16
|
*/
|
|
17
17
|
function getPluginName(projectPath) {
|
|
18
|
+
// Check app-manifest.json first
|
|
19
|
+
try {
|
|
20
|
+
const manifestPath = path.join(projectPath, "app-manifest.json");
|
|
21
|
+
if (fs.existsSync(manifestPath)) {
|
|
22
|
+
const manifest = JSON.parse(fs.readFileSync(manifestPath, "utf-8"));
|
|
23
|
+
if (manifest.name) {
|
|
24
|
+
return manifest.name.replace(/[^a-zA-Z0-9-_]/g, "-");
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
} catch (error) {
|
|
28
|
+
console.warn("Could not read app-manifest.json, falling back to package.json");
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
// Fall back to package.json
|
|
18
32
|
try {
|
|
19
33
|
const packageJsonPath = path.join(projectPath, "package.json");
|
|
20
34
|
if (fs.existsSync(packageJsonPath)) {
|
package/package.json
CHANGED
package/runtime/vite.config.js
CHANGED
|
@@ -303,6 +303,9 @@ export default defineConfig(({ mode }) => {
|
|
|
303
303
|
port: parseInt(env.NODE_PORT) || 3060,
|
|
304
304
|
strictPort: true,
|
|
305
305
|
https: getHttpsConfig(env),
|
|
306
|
+
allowedHosts: env.ALLOWED_HOSTS
|
|
307
|
+
? env.ALLOWED_HOSTS.split(",").map((h) => h.trim()).filter(Boolean)
|
|
308
|
+
: [],
|
|
306
309
|
cors: {
|
|
307
310
|
origin: "*",
|
|
308
311
|
methods: ["GET", "POST", "PUT", "DELETE", "OPTIONS"],
|
package/template/vite.config.js
CHANGED
|
@@ -252,6 +252,9 @@ export default defineConfig(({ mode }) => {
|
|
|
252
252
|
port: parseInt(env.NODE_PORT) || 3060,
|
|
253
253
|
strictPort: true,
|
|
254
254
|
https: getHttpsConfig(env),
|
|
255
|
+
allowedHosts: env.ALLOWED_HOSTS
|
|
256
|
+
? env.ALLOWED_HOSTS.split(",").map((h) => h.trim()).filter(Boolean)
|
|
257
|
+
: [],
|
|
255
258
|
cors: {
|
|
256
259
|
origin: "*",
|
|
257
260
|
methods: ["GET", "POST", "PUT", "DELETE", "OPTIONS"],
|