@zubyjs/react 1.0.34 → 1.0.36

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/package.json +1 -1
  2. package/router.js +4 -3
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zubyjs/react",
3
- "version": "1.0.34",
3
+ "version": "1.0.36",
4
4
  "description": "Zuby.js JsxProvider for react",
5
5
  "type": "module",
6
6
  "main": "index.js",
package/router.js CHANGED
@@ -10,17 +10,18 @@ let errors;
10
10
  * Zuby's Router component provides support for file-system based routing.
11
11
  */
12
12
  export default function Router({ context }) {
13
+ const isProduction = import.meta?.env?.MODE === 'production';
13
14
  const loadTemplates = (templates) => templates?.map((pageTemplate) => ({
14
15
  ...pageTemplate,
15
16
  component: lazy(pageTemplate.component),
16
17
  })) || [];
17
- if (!pages) {
18
+ if (!pages || !isProduction) {
18
19
  pages = loadTemplates(context.templates?.pages);
19
20
  }
20
- if (!apps) {
21
+ if (!apps || !isProduction) {
21
22
  apps = loadTemplates(context.templates?.apps);
22
23
  }
23
- if (!errors) {
24
+ if (!errors || !isProduction) {
24
25
  errors = loadTemplates(context.templates?.errors);
25
26
  }
26
27
  const app = apps.find(({ pathRegex }) => {