@olenbetong/appframe-vite 2.2.4 → 2.2.5
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/lib/devServer.js +12 -12
- package/package.json +2 -2
package/lib/devServer.js
CHANGED
|
@@ -19,7 +19,7 @@ async function getUserSession() {
|
|
|
19
19
|
let client = new Client(hostname);
|
|
20
20
|
await client.login(username, password);
|
|
21
21
|
let userResult = await client.afFetch("/api/system/usersession", {
|
|
22
|
-
timeout: 5000
|
|
22
|
+
timeout: 5000,
|
|
23
23
|
});
|
|
24
24
|
userSession = await userResult.json();
|
|
25
25
|
return userSession;
|
|
@@ -48,13 +48,13 @@ export function createProxyMiddleware() {
|
|
|
48
48
|
"/exec/*",
|
|
49
49
|
"/report/*",
|
|
50
50
|
"/rowcount/*",
|
|
51
|
-
"/lib/*"
|
|
51
|
+
"/lib/*",
|
|
52
52
|
];
|
|
53
53
|
if (appframe.proxy?.routes) {
|
|
54
54
|
proxyRoutes.push(...appframe.proxy.routes);
|
|
55
55
|
}
|
|
56
56
|
const router = express.Router();
|
|
57
|
-
proxyRoutes.forEach(route => {
|
|
57
|
+
proxyRoutes.forEach((route) => {
|
|
58
58
|
router.use(route, proxy);
|
|
59
59
|
});
|
|
60
60
|
return router;
|
|
@@ -64,7 +64,14 @@ export function createHtmlTransformer() {
|
|
|
64
64
|
let isPartner = appPkg.appframe?.article?.hostname === "partner.olenbetong.no";
|
|
65
65
|
let userSession = await getUserSession();
|
|
66
66
|
return html
|
|
67
|
-
.replace("<!-- {Appframe} -->", `<script>
|
|
67
|
+
.replace("<!-- {Appframe} -->", `<script src="/lib/@olenbetong/appframe-core/2.0.2/dist/iife/af.common.js"></script>
|
|
68
|
+
<script src="/lib/@olenbetong/appframe-data/0.2.3/dist/iife/af.data.js"></script>
|
|
69
|
+
<script>
|
|
70
|
+
af = globalThis.af ?? {};
|
|
71
|
+
af.userSession = ${JSON.stringify(userSession)};
|
|
72
|
+
</script>
|
|
73
|
+
<script src="/file/article/static-script/${appframe.article.id}.js"></script>
|
|
74
|
+
<script>
|
|
68
75
|
var SkipToConfig = {
|
|
69
76
|
'settings': {
|
|
70
77
|
'skipTo': {
|
|
@@ -93,14 +100,7 @@ var SkipToConfig = {
|
|
|
93
100
|
}
|
|
94
101
|
};
|
|
95
102
|
</script>
|
|
96
|
-
<script src="/lib/paypal-skipto/downloads/js/skipto.min.js" async></script
|
|
97
|
-
<script src="/lib/@olenbetong/appframe-core/2.0.2/dist/iife/af.common.js"></script>
|
|
98
|
-
<script src="/lib/@olenbetong/appframe-data/0.2.3/dist/iife/af.data.js"></script>
|
|
99
|
-
<script>
|
|
100
|
-
af = globalThis.af ?? {};
|
|
101
|
-
af.userSession = ${JSON.stringify(userSession)};
|
|
102
|
-
</script>
|
|
103
|
-
<script src="/file/article/static-script/${appframe.article.id}.js"></script>`)
|
|
103
|
+
<script src="/lib/paypal-skipto/downloads/js/skipto.min.js" async></script>`)
|
|
104
104
|
.replace(`<!-- {Theme} -->`, isPartner
|
|
105
105
|
? ` <link rel="stylesheet" href="/file/site/style/ob.application.min.css" />
|
|
106
106
|
<link rel="stylesheet" href="/file/site/style/ob.theme.base.less" />
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@olenbetong/appframe-vite",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.5",
|
|
4
4
|
"description": "Tools to use and deploy Vite applications to Appframe",
|
|
5
5
|
"main": "./lib/index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -39,5 +39,5 @@
|
|
|
39
39
|
"open": "^8.4.0",
|
|
40
40
|
"tcp-port-used": "^1.0.2"
|
|
41
41
|
},
|
|
42
|
-
"gitHead": "
|
|
42
|
+
"gitHead": "4b1a647f568dfed70e408aced03cf9094137f05b"
|
|
43
43
|
}
|