@ubox-tools/deploy-xperience 1.1.7 → 1.1.9
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/deploy.js +12 -2
- package/package.json +1 -1
package/deploy.js
CHANGED
|
@@ -256,6 +256,16 @@ function generateProxy(appName) {
|
|
|
256
256
|
}
|
|
257
257
|
|
|
258
258
|
if (isHTML) {
|
|
259
|
+
// Asset path substitution for HTML src/href attributes
|
|
260
|
+
const assetInStringRe = /(['"])(?:\.\.\/)*assets\/([^'"]+)\1/g;
|
|
261
|
+
content = content.replace(assetInStringRe, (match, quote, assetFile) => {
|
|
262
|
+
const assetExt = path.extname(assetFile).slice(1).toLowerCase();
|
|
263
|
+
const type = assetResourceType(assetExt);
|
|
264
|
+
const absPath = path.join(ASSETS_DIR, assetFile);
|
|
265
|
+
if (fs.existsSync(absPath)) assets[assetFile] = { type, absPath };
|
|
266
|
+
return `"{resources:${type}/${assetFile}}"`;
|
|
267
|
+
});
|
|
268
|
+
|
|
259
269
|
// Strip local <link> tags (keep CDN ones with https://)
|
|
260
270
|
content = content.replace(/<link\b[^>]*\bhref=["'](?!https?:\/\/)[^"']*["'][^>]*\/?>/gi, '');
|
|
261
271
|
// Strip local <script src> tags (keep CDN ones)
|
|
@@ -613,8 +623,8 @@ async function configureParameters(page, params) {
|
|
|
613
623
|
const values = [
|
|
614
624
|
key,
|
|
615
625
|
def.description || '',
|
|
616
|
-
def.value
|
|
617
|
-
def['default value']
|
|
626
|
+
String(def.value ?? key),
|
|
627
|
+
String(def['default value'] ?? key),
|
|
618
628
|
];
|
|
619
629
|
|
|
620
630
|
for (let i = 0; i < Math.min(fieldRects.length, values.length); i++) {
|
package/package.json
CHANGED