@nestjs-ssr/react 0.1.1 → 0.1.2

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.
@@ -367,6 +367,7 @@ declare class RenderService {
367
367
  private serverManifest;
368
368
  private isDevelopment;
369
369
  private ssrMode;
370
+ private readonly entryServerPath;
370
371
  constructor(templateParser: TemplateParserService, streamingErrorHandler: StreamingErrorHandler, ssrMode?: SSRMode, defaultHead?: HeadData | undefined);
371
372
  setViteServer(vite: ViteDevServer): void;
372
373
  /**
@@ -367,6 +367,7 @@ declare class RenderService {
367
367
  private serverManifest;
368
368
  private isDevelopment;
369
369
  private ssrMode;
370
+ private readonly entryServerPath;
370
371
  constructor(templateParser: TemplateParserService, streamingErrorHandler: StreamingErrorHandler, ssrMode?: SSRMode, defaultHead?: HeadData | undefined);
371
372
  setViteServer(vite: ViteDevServer): void;
372
373
  /**
package/dist/index.d.mts CHANGED
@@ -1,5 +1,5 @@
1
- import { H as HeadData } from './index-Bptct1Q3.mjs';
2
- export { E as ErrorPageDevelopment, f as ErrorPageProduction, c as RenderConfig, b as RenderInterceptor, R as RenderModule, e as RenderResponse, a as RenderService, d as SSRMode, S as StreamingErrorHandler, T as TemplateParserService } from './index-Bptct1Q3.mjs';
1
+ import { H as HeadData } from './index-C7qZ7BPg.mjs';
2
+ export { E as ErrorPageDevelopment, f as ErrorPageProduction, c as RenderConfig, b as RenderInterceptor, R as RenderModule, e as RenderResponse, a as RenderService, d as SSRMode, S as StreamingErrorHandler, T as TemplateParserService } from './index-C7qZ7BPg.mjs';
3
3
  import * as _nestjs_common from '@nestjs/common';
4
4
  export { viewRegistryPlugin } from './vite/index.mjs';
5
5
  import 'react';
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { H as HeadData } from './index-Bptct1Q3.js';
2
- export { E as ErrorPageDevelopment, f as ErrorPageProduction, c as RenderConfig, b as RenderInterceptor, R as RenderModule, e as RenderResponse, a as RenderService, d as SSRMode, S as StreamingErrorHandler, T as TemplateParserService } from './index-Bptct1Q3.js';
1
+ import { H as HeadData } from './index-C7qZ7BPg.js';
2
+ export { E as ErrorPageDevelopment, f as ErrorPageProduction, c as RenderConfig, b as RenderInterceptor, R as RenderModule, e as RenderResponse, a as RenderService, d as SSRMode, S as StreamingErrorHandler, T as TemplateParserService } from './index-C7qZ7BPg.js';
3
3
  import * as _nestjs_common from '@nestjs/common';
4
4
  export { viewRegistryPlugin } from './vite/index.js';
5
5
  import 'react';
package/dist/index.js CHANGED
@@ -453,12 +453,16 @@ exports.RenderService = class _RenderService {
453
453
  serverManifest = null;
454
454
  isDevelopment;
455
455
  ssrMode;
456
+ entryServerPath;
456
457
  constructor(templateParser, streamingErrorHandler, ssrMode, defaultHead) {
457
458
  this.templateParser = templateParser;
458
459
  this.streamingErrorHandler = streamingErrorHandler;
459
460
  this.defaultHead = defaultHead;
460
461
  this.isDevelopment = process.env.NODE_ENV !== "production";
461
462
  this.ssrMode = ssrMode || process.env.SSR_MODE || "string";
463
+ const absoluteTemplatePath = path2.join(__dirname, "../templates/entry-server.tsx");
464
+ const relativeToApp = path2.relative(process.cwd(), absoluteTemplatePath);
465
+ this.entryServerPath = "/" + relativeToApp.replace(/\\/g, "/");
462
466
  let templatePath;
463
467
  if (this.isDevelopment) {
464
468
  const packageTemplatePaths = [
@@ -554,7 +558,7 @@ exports.RenderService = class _RenderService {
554
558
  }
555
559
  let renderModule;
556
560
  if (this.vite) {
557
- renderModule = await this.vite.ssrLoadModule("/src/entry-server.tsx");
561
+ renderModule = await this.vite.ssrLoadModule(this.entryServerPath);
558
562
  } else {
559
563
  if (this.serverManifest) {
560
564
  const manifestEntry = Object.entries(this.serverManifest).find(([key, value]) => value.isEntry && key.includes("entry-server"));
@@ -638,7 +642,7 @@ exports.RenderService = class _RenderService {
638
642
  const templateParts = this.templateParser.parseTemplate(template);
639
643
  let renderModule;
640
644
  if (this.vite) {
641
- renderModule = await this.vite.ssrLoadModule("/src/entry-server.tsx");
645
+ renderModule = await this.vite.ssrLoadModule(this.entryServerPath);
642
646
  } else {
643
647
  if (this.serverManifest) {
644
648
  const manifestEntry = Object.entries(this.serverManifest).find(([key, value]) => value.isEntry && key.includes("entry-server"));
@@ -7119,10 +7123,10 @@ var Ignore = class {
7119
7123
  ignored(p) {
7120
7124
  const fullpath = p.fullpath();
7121
7125
  const fullpaths = `${fullpath}/`;
7122
- const relative = p.relative() || ".";
7123
- const relatives = `${relative}/`;
7126
+ const relative2 = p.relative() || ".";
7127
+ const relatives = `${relative2}/`;
7124
7128
  for (const m of this.relative) {
7125
- if (m.match(relative) || m.match(relatives)) return true;
7129
+ if (m.match(relative2) || m.match(relatives)) return true;
7126
7130
  }
7127
7131
  for (const m of this.absolute) {
7128
7132
  if (m.match(fullpath) || m.match(fullpaths)) return true;
@@ -7131,9 +7135,9 @@ var Ignore = class {
7131
7135
  }
7132
7136
  childrenIgnored(p) {
7133
7137
  const fullpath = p.fullpath() + "/";
7134
- const relative = (p.relative() || ".") + "/";
7138
+ const relative2 = (p.relative() || ".") + "/";
7135
7139
  for (const m of this.relativeChildren) {
7136
- if (m.match(relative)) return true;
7140
+ if (m.match(relative2)) return true;
7137
7141
  }
7138
7142
  for (const m of this.absoluteChildren) {
7139
7143
  if (m.match(fullpath)) return true;