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 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 serve path represents the base of the application. Accessing a different path (`/api/` for instance) should not cause the application to load if the application's base is `/test/`
The underlying webpack dev server builder is responsible for determining the actual port value for dynamic port cases (port = 0). This change uses that value to generate the full URL for accessing the dev server.
By default the application will be served with inline mode enabled. This means that a script will be inserted in your bundle to take care of live reloading.
However at the moment we are already adding these scripts in `_addLiveReload` method.
With this change we always disable this behaviour and only add it when needed via the `_addLiveReload` logic.
Eventually we should try to remove the logic and rely on webpack-dev-server interals.
Fixes#14300
This PR adds differential loading to the browser builder. First, it checks if differential loading is needed. This is the case if the compilation target is ES2015 while the browserslist points to ES5 browsers.
For providing differential loading, it calls the methods for creating the webpack config for each compilation target (e. g. ES5 and ES2015). The needed differences between those configurations are defined using parameters also added by this PR. Then it calls webpack for each of them and merges the results
This feature is currently hidden behind a flag. To activate it, set the differentialLoading flag in browser/index.ts.
If a custom path is provided the webpack dev server client drops the sockjs-node segment. This adds it back so that behavior is consistent when using a custom URL path.
Fixes#13627
Remove the manually maintained schema.d.ts from the browser builder, and use
the Schema JSON file to generate it. This had a lot of repercussions around
the whole build-angular code base and the different interfaces that were
manually kept.
The warning points to a solution for the WDS disconnect issue. Using --disable-host-check
will additionally warn the user that this might be insecure.
Fixes#11060
* feat(@angular/cli): update schema to match new `sourceMap`
* feat(@angular-devkit/build-angular): fine grain settings for sourceMaps
This PR add more control over which sourceMaps you want, Now you can enable sourceMaps for scripts only, styles only or both. Also we added another functionality which are hidden sourcemaps. These are normaly used for error reporting tools.
Fixes#7527