7 Commits

Author SHA1 Message Date
Alan Agius
eb30a92e8a feat(@angular-devkit/build-angular): enable inlining of critical CSS optimizations
This is another feature that we mentioned in the Eliminate Render Blocking Requests RFC (#18730)

Inlining of critical CSS is turned off by default. To opt-in this feature set `inlineCritical` to `true`.

Example:
```json
"configurations": {
  "production": {
    "fileReplacements": [
      {
        "replace": "src/environments/environment.ts",
        "with": "src/environments/environment.prod.ts"
      }
    ],
    "optimization": {
      "styles": {
        "minify": true,
        "inlineCritical": true,
       }
    },
```

To learn more about critical CSS see;
https://web.dev/defer-non-critical-css
https://web.dev/extract-critical-css/

In a future version of the Angular CLI `inlineCritical` will be enabled by default.

Closes: #17966
Closes: #11395
Closes: #19445
2020-12-04 15:41:29 -05:00
Alan Agius
2298ab865b refactor(@angular-devkit/build-angular): remove deprecated browser build option rebaseRootRelativeCssUrls
BREAKING CHANGE:

Deprecated `rebaseRootRelativeCssUrls` browser builder option has been removed without replacement. This option was used to change root relative URLs in stylesheets to include base HREF and deploy URL and was used only for compatibility and transition as this behavior is non-standard.
2020-10-20 16:53:24 +02:00
Alan Agius
247b87d40a refactor(@angular-devkit/build-angular): move dev-server webpack config in a separate file
With this change we remove webpack dev-server logic to a seperate file. We also use the webpack-dev-server API to add live-reload and hmr entry-points and settings.
2020-10-16 21:08:18 +02:00
Alan Agius
e253fffbe6 refactor(@angular-devkit/build-angular): move addition of HMR plugins and loaders to webpack configs 2020-10-14 21:57:47 +03:00
Alan Agius
e30e578d22 build: update mini-css-extract-plugin to version 1.0.0 2020-10-14 21:57:47 +03:00
Alan Agius
f10f910ec9 refactor(@angular-devkit/build-angular): remove esVersionInFileName build option
This option can be determined via `wco.differentialLoadingMode`
2020-09-23 11:22:58 -05:00
Alan Agius
0d10de5cbb refactor(@angular-devkit/build-angular): re-structure folder structure and move code
Previous
```
packages/angular_devkit/build_angular
├── plugins
│   └── webpack
└── src
    ├── angular-cli-files
    │   ├── models
    │   │   └── webpack-configs
    │   ├── plugins
    │   └── utilities
    │       ├── index-file
    │       └── service-worker
    ├── app-shell
    ├── browser
    │   └── specs
    ├── dev-server
    ├── extract-i18n
    ├── karma
    ├── ng-packagr
    ├── protractor
    ├── server
    ├── tslint
    ├── utils
    └── webpack
        └── models
```

Now
```
packages/angular_devkit/build_angular
├── plugins
└── src
    ├── app-shell
    ├── browser
    │   └── specs
    ├── dev-server
    ├── extract-i18n
    ├── karma
    ├── ng-packagr
    ├── protractor
    ├── server
    ├── tslint
    ├── utils
    │   └── index-file
    └── webpack
        ├── configs
        ├── plugins
        └── utils
```
2020-09-14 16:40:39 -04:00