@pronto-tools-and-more/components-renderer 9.6.0 → 9.7.0
Sign up to get free protection for your applications and to get access to all the features.
package/package.json
CHANGED
@@ -4,8 +4,16 @@ import * as LoadRoutes from "../LoadRoutes/LoadRoutes.js";
|
|
4
4
|
import * as LoadSwc from "../LoadSwc/LoadSwc.js";
|
5
5
|
import * as RenderView from "../RenderView/RenderView.js";
|
6
6
|
import * as SetAssetDir from "../SetAssetDir/SetAssetDir.js";
|
7
|
+
import * as SetPathPrefix from "../SetPathPrefix/SetPathPrefix.js";
|
7
8
|
import * as SwcNodePath from "../SwcNodePath/SwcNodePath.js";
|
8
9
|
|
10
|
+
const getRealPathPrefix = (isBuild, pathPrefix) => {
|
11
|
+
if (!isBuild) {
|
12
|
+
return "/#";
|
13
|
+
}
|
14
|
+
return pathPrefix;
|
15
|
+
};
|
16
|
+
|
9
17
|
export const renderViews = async (
|
10
18
|
componentsPathMain,
|
11
19
|
tsconfigPath,
|
@@ -20,6 +28,9 @@ export const renderViews = async (
|
|
20
28
|
const assetDir = isBuild ? "resource://dynamic/storefront/assets" : "";
|
21
29
|
SetAssetDir.setAssetDir(assetDir);
|
22
30
|
|
31
|
+
const realPathPrefix = getRealPathPrefix(isBuild, pathPrefix);
|
32
|
+
SetPathPrefix.setPathPrefix(realPathPrefix);
|
33
|
+
|
23
34
|
const module = await LoadRoutes.loadRoutes(componentsPathMain);
|
24
35
|
const values = Object.values(module);
|
25
36
|
// TODO return views string instead of json for faster performance?
|