This project was generated with Angular CLI version 8.0.3.
npm install
npm run build:ssr && npm run serve:ssr
this project is consuming stencil web components from @ponkys/consumer-web-components-test
dependency declared in package json. This includes the hydrate
folder in the dist (I manually pasted it there). In a stencil project add the following object to the outputTargets array in stencil.config.js
:
{
type: 'dist-hydrate-script'
}
this hydrate folder exposes renderToString
and hydrateDocument
methods that are useful for ssr.
file index.js
from node_modules/@ponkys/consumer-web-components-test/dist/hydrate/index.js
in line 19.
const filePath = path.resolve(process.cwd(), `node_modules/@ponkys/consumer-web-components-test/dist/hydrate/app.js`);
It seems that Angular universal has wrong node __dirname
set.