In version 9 universal express and hapi `server.ts` will be bundled using the CLI server builder.
We need to add this to avoid `the request of a dependency is an expression` warnings
See: https://github.com/angular/universal/pull/1237
This also allows terser to perform ECMA 6 level compress optimizations on the actual application bundles (non-script bundles) which can provide for further size improvements.
Fixes#15507
BREAKING CHANGE: bundleDependencies default value has been changed from none to all. This will result in all of node_modules to be bundled in the final server bundle.
Under Ivy, if users choose to opt-out from bundling dependencies they will need to run NGCC binary manually to make non-bundled node_modules compatible with Ivy.
`--poll` is a valid command line option (vs. `--poll 1000`). This however will result in a value of 0 which causes polling to be disabled rather than enabled. This change sets a default value of 500 when the commandline flag is used.
With this change we address 2 main issues related to unbound breakpoints:
1) in VS code when having a `baseHref` set.
2) Visual Studio when using an SPA inside a ASP.NET project
For the latter, it seems that there is no way to set a `webRoot`. However, `webpack:///` seems to be handled internally and will be mapped to the `SpaRoot` ie `ClientApp` folder.
Fixes: #15211
`namespace` is always empty which is breaking sourcemaps since when sources start with `/` vscode will not be able to resolve them unless users configure `sourceMapPathOverrides`.
Fixes#15116
It’s very easy to inadvertently import toplevel css in component styles. Since component css is standalone and self-contained, it will never be shared between components and remains as a single large bundle for each component. This in turn adds a large amount of code that must be processed and increases bundle size.
Related to: TOOL-949
Webpack and its development server assume the presence of two node builtins (`events` & `querystring`). Do to package hoisting npm/yarn will usually place the shims for those two builtins at locations that webpack find them. This is however not guaranteed nor will it work with pnpm which strictly follows the prescribed dependency tree.
To remedy this, the specific node shims are enabled only for the specific internal webpack files that are used within the development server. This ensures that the requirements of these files does not pollute the entire application.
Fixes#13680
This change synchronizes the behavior of classic scripts and module scripts (`type="module"`). Module scripts are deferred by default. Also, certain injected scripts are not considered module scripts even in a ES2015+ build due to the strict mode behavior of module scripts. Deferring such scripts also ensures consistent execution in those scenarios.
This allows the output path of an application's index HTML file to be controlled independently of the input file. The output path for the file will be considered relative to the application's configured output path. This allows an application to contain multiple input index files for different configurations and allow the output file to remain constant. This also enables the placement of the index file in a subdirectory within the output path or change the name of the output index file neither of which was previously possible.
`ng serve` was errantly adding a module type to custom script bundles. These scripts may contain ES5 and non-strict compatible code and can therefore not be marked as module scripts. `ng build` already correctly operates in this fashion.
Fixes#14952
The lazy option inside the script and style option is confusing as this option doesn't lazy load a bundle but rather it doesn't inject/reference the script in the HTML. While this option is an enabler for lazy loading, the users will still need to handle on how how this bundle will be lazy loaded. There are also potential use cases beyond lazy loading for the option.
Closes#14814