@olenbetong/appframe-vite 1.0.0 → 1.0.1

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/lib/devServer.js +11 -1
  2. package/package.json +1 -1
package/lib/devServer.js CHANGED
@@ -63,8 +63,10 @@ export async function createDevMiddleware(vite) {
63
63
  throw new Error("Your Appframe credentials are not set in the environment variables. Username should be set in APPFRAME_LOGIN and password in APPFRAME_PWD.");
64
64
  }
65
65
  return async (req, res, next) => {
66
+ var _a, _b;
66
67
  const url = req.originalUrl;
67
68
  try {
69
+ let isPartner = ((_b = (_a = appPkg.appframe) === null || _a === void 0 ? void 0 : _a.article) === null || _b === void 0 ? void 0 : _b.hostname) === "partner.olenbetong.no";
68
70
  let template = await fs.readFile(path.resolve(process.cwd(), "index.html"), "utf-8");
69
71
  template = await vite.transformIndexHtml(url, template);
70
72
  let userSession = await getUserSession(hostname, username, password);
@@ -74,7 +76,15 @@ af = globalThis.af ?? {};
74
76
  af.userSession = ${JSON.stringify(userSession)};
75
77
  </script>
76
78
  <script src="/file/article/static-script/${appframe.article.id}.js"></script>`)
77
- .replace(`<!-- {Theme} -->`, `<link rel="stylesheet" href="/file/site/style/ob.theme.base.less" />
79
+ .replace(`<!-- {Theme} -->`, isPartner
80
+ ? ` <link rel="stylesheet" href="/file/site/style/ob.application.min.css" />
81
+ <link rel="stylesheet" href="/file/site/style/ob.theme.base.less" />
82
+ <link rel="stylesheet" href="/file/site/style/ob.theme.betongost.less" />
83
+ <link rel="stylesheet" href="/file/site/style/ob.theme.olenbetong.less" />
84
+ <link rel="stylesheet" href="/file/site/style/ob.theme.ribe.less" />
85
+ <link rel="stylesheet" href="/file/site/style/ob.theme.sjb.less" />
86
+ `
87
+ : ` <link rel="stylesheet" href="/file/site/style/ob.theme.base.less" />
78
88
  <link rel="stylesheet" href="/file/site/style/ob.theme.betongost.less" />
79
89
  <link rel="stylesheet" href="/file/site/style/ob.theme.forsand.less" />
80
90
  <link rel="stylesheet" href="/file/site/style/ob.theme.olenbetong.less" />
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@olenbetong/appframe-vite",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "Tools to use and deploy Vite applications to Appframe",
5
5
  "main": "./lib/index.js",
6
6
  "type": "module",