8 Commits

Author SHA1 Message Date
Alan Agius
4b09887a9c feat(@angular/ssr): move CommonEngine API to /node entry-point
Refactored the `CommonEngine` API import path to remove Node.js dependencies from the `@angular/ssr` main entry-point.

BREAKING CHANGE:

The `CommonEngine` API now needs to be imported from `@angular/ssr/node`.

**Before**
```ts
import { CommonEngine } from '@angular/ssr';
```

**After**
```ts
import { CommonEngine } from '@angular/ssr/node';
```
2024-08-27 08:57:37 +02:00
Alan Agius
2acf95a949 fix(@angular-devkit/build-angular): do not generate an index.html file in the browser directory when using SSR.
BREAKING CHANGE: By default, the index.html file is no longer emitted in the browser directory when using the application builder with SSR. Instead, an index.csr.html file is emitted. This change is implemented because in many cases server and cloud providers incorrectly treat the index.html file as a statically generated page. If you still require the old behavior, you can use the `index` option to specify the `output` file name.

```json
"architect": {
  "build": {
    "builder": "@angular-devkit/build-angular:application",
    "options": {
      "outputPath": "dist/my-app",
      "index": {
        "input": "src/index.html",
        "output": "index.html"
      }
    }
  }
}
```
2024-04-10 17:00:50 +02:00
Alan Agius
a673baf5ce Revert "fix(@schematics/angular): rename SSR port env variable"
This reverts commit 950a44521fdfb82000f6564ccc4c87d4a2b94680.
2024-04-02 11:51:45 -07:00
Paweł Kubiak
950a44521f fix(@schematics/angular): rename SSR port env variable
Rename the SSR port env variable to SSR_PORT.
It could help to resolve this firebase issue: https://github.com/firebase/firebase-tools/issues/6651#issuecomment-1881647322, cause PORT is reserved environment variable: https://firebase.google.com/docs/functions/config-env?gen=2nd#reserved-names.
2024-03-22 13:23:31 -04:00
Alan Agius
a708dccff3 feat(@schematics/angular): update SSR and application builder migration schematics to work with new outputPath
In #26675 we introduced a long-form variant of `outputPath`, this commit updates the application builder migration and ssr schematics to handle this change.
2023-12-19 07:20:25 +01:00
Alan Agius
f6a088bc18 fix(@angular/ssr): correctly set config URL
When calling `renderApplication` or `renderModule` the URL would be overridden to undefined as the `url` option was not provided as an option.
2023-10-24 16:11:45 +02:00
Alan Agius
49f07a84d6 feat(@angular-devkit/build-angular): standardize application builder output structure
This commit updates the application builder to output files in a standardized manner. The builder will output a `browser` directory for all the files that can be accessible by the browser, and a `server` directory that contains the SSR application. Both of these directories are created as children in the configured `outputPath`. Stats and license files will be outputted directly in the configured `outputPath`.

Example of output:
```
3rdpartylicenses.txt
├── browser
│   ├── chunk-2XJVAMHT.js
│   ├── favicon.ico
│   ├── index.html
│   ├── main-6JLMM7WW.js
│   ├── polyfills-4UVFGIFL.js
│   └── styles-5INURTSO.css
└── server
    ├── chunk-4ZCEIHD4.mjs
    ├── chunk-PMR7BAU4.mjs
    ├── chunk-TSP6W7K5.mjs
    ├── index.server.html
    ├── main.server.mjs
    └── server.mjs
```
2023-10-05 13:30:52 -04:00
Alan Agius
6a85b13b1f refactor(@angular/ssr): move ng-add schematic to @schematics/angular
This move is in preparation to enable `ng new --ssr`.
2023-09-25 20:17:01 +02:00