1471 Commits

Author SHA1 Message Date
Renovate Bot
3d0b6be0ea build: update mini-css-extract-plugin to version 1.1.0 2020-10-20 09:21:16 +02:00
Alan Agius
bfb33b15e1 refactor(@angular-devkit/build-angular): remove support for TypeScript 3.9
BREAKING CHANGE:

TypeScript 3.9 is no longer supported, please upgrade to TypeScript 4.0.
2020-10-20 08:52:27 +02:00
Alan Agius
54fc6f1923 refactor(@angular-devkit/build-angular): minor cleanup to dev-server code 2020-10-20 08:51:41 +02:00
Alan Agius
7b77e92338 refactor(@angular-devkit/build-angular): remove allowed webpack and @angular-devkit/build-angular from CommonJsUsageWarnPlugin
These are no longer needed
2020-10-20 08:51:41 +02:00
Renovate Bot
ff07ef8e8e build: update terser to version 5.3.7 2020-10-19 20:18:07 +02:00
Jaime Oliveira
ae94245131 fix(@angular-devkit/build-angular): add a base href to karma debug context
This commits adds a base href value in the karma context iframe used to run unit tests where a unit test throws:
No base href set. Please provide a value for the APP_BASE_HREF token or add a base element to the document.
Even if the application is fine.
This is because the index.html from Angular CLI contains a base href value, but not the Karma context iframe.
So when adding a unit test with a testing module that imports a NgModule, for example AppModule,
which itself imports RouterModule, the unit test used to throw an error (regression appeared in router 3.1).
That could be solved by either adding `RouterTestingModule` to the testing module,
or by adding a provider `{ provide: APP_BASE_HREF, useValue: '/' }`, but required to understand the issue.
This solves the issue in a transparent way: developers won't even encounter the problem anymore.

Closes #19116
2020-10-19 12:34:47 +02:00
Renovate Bot
3a29d8abd7 build: update webpack-subresource-integrity to version 1.5.1 2020-10-19 09:55:57 +02:00
Renovate Bot
4c1c11eda8 build: update rollup to version 2.32.0 2020-10-17 16:01:26 +02:00
Renovate Bot
72d340fb46 build: update babel packages 2020-10-17 16:00:41 +02:00
Alan Agius
574d309cda fix(@angular-devkit/build-angular): don't set watchOptions in webpack-middleware
`webpack-dev-middleware` doesn't have a `watchOptions`

See: https://github.com/webpack/webpack-dev-middleware/blob/master/src/options.json
2020-10-16 21:08:18 +02:00
Alan Agius
f7f6eede23 fix(@angular-devkit/build-angular): disable dev-server live-reload when using protoactor
LIve-reload is not needed when using protoactor because watch mode is always disabled.
2020-10-16 21:08:18 +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
710e12dd7d fix(@angular-devkit/build-angular): correctly reference hmr-accept.js file in windows error
Backslashes need to be changed to forward slashes for absolute imports to work in Windows.

Closes #19099
2020-10-16 21:03:57 +02:00
Charles Lyding
eac9e994a6 fix(@angular-devkit/build-angular): ensure correct SRI values with differential loading
Previously, the cached integrity values for a subsequent differential loading build would not be properly integrated.  This resulted in builds with incorrect integrity values after an initial build.  The cached differential loading builds will now use the correct integrity values on subsequent builds.

Closes #18254
2020-10-16 12:07:16 +02:00
Renovate Bot
6937a3e1ae build: update rollup to version 2.31.0 2020-10-16 12:07:01 +02:00
Charles Lyding
58a7deac67 fix(@angular-devkit/build-angular): set HTML lang attribute when serving
When using the non-deprecated localization options, the development server was not properly setting the HTML `lang` attribute for the application.  This change ensures that the active locale is used within the application's index HTML file.

Closes #18094
2020-10-15 18:59:32 +02:00
Alan Agius
e1d0d0898d docs(@angular-devkit/build-angular): improve headers option description 2020-10-15 18:30:24 +02:00
Alan Agius
4d2f4ec2c1 fix(@angular-devkit/build-angular): override already existing assets in compilation
With this change we align the copying of assets between `ng build` and `ng serve`. Previously in `ng serve` already copied assets where not overridden.

More info: https://webpack.js.org/plugins/copy-webpack-plugin/#force

Closes #18787
2020-10-15 17:16:59 +02:00
Alan Agius
1d0d90e1b1 refactor(@angular-devkit/build-angular): simplify global_defs usage from @angular/compiler-cli.
This change results in the same options being set. See: 66e6b932d8/packages/compiler-cli/src/tooling.ts (L25-L34)
2020-10-15 16:10:35 +02:00
Renovate Bot
d05c70e606 build: update core-js to version 3.6.5 2020-10-15 07:37:14 +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
7253802d74 refactor(@angular-devkit/build-angular): change hmr-accept to TypeScript
For the time being we cannot use the DOM lib because it conflicts with Node, In future when we remove `yarn admin build` we should have this as a seperate compilation unit.
2020-10-14 21:57:47 +03:00
Alan Agius
c345ec369f test(@angular-devkit/build-angular): test HMR using puppeteer 2020-10-14 21:57:47 +03:00
Alan Agius
16f7767983 fix(@angular-devkit/build-angular): remove .js files equivalent of css when using extract css 2020-10-14 21:57:47 +03:00
Alan Agius
221e821cad refactor(@angular-devkit/build-angular): use __filename instead of __dirname + filename 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
3c2da34972 fix(@angular-devkit/build-angular): only show cannot restore inputs/options when old length is > 0 2020-10-14 21:57:47 +03:00
Alan Agius
49841f84c5 fix(@angular-devkit/build-angular): include HMR accept code in main.ts
This fixes as issue where in some cases the changed module is not accepted which cases the dev-server to fallback to live-reload.

This is because the hmr.js and main.ts have different module ids.
2020-10-14 21:57:47 +03:00
Alan Agius
871dd6a434 feat(@angular-devkit/build-angular): enable font inlining optimizations
With this change we inline Google fonts and icons in the index html file when optimization is enabled.

**Before**
```html
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">
```
**After**
```html
<style>
  @font-face {
    font-family: 'Material Icons';
    font-style: normal;
    font-weight: 400;
    src: url(https://fonts.gstatic.com/s/materialicons/v55/flUhRq6tzZclQEJ-Vdg-IuiaDsNcIhQ8tQ.woff2) format('woff2');
  }

  .material-icons {
    font-family: 'Material Icons';
    font-weight: normal;
    font-style: normal;
    font-size: 24px;
    line-height: 1;
    letter-spacing: normal;
    text-transform: none;
    display: inline-block;
    white-space: nowrap;
    word-wrap: normal;
    direction: ltr;
  }
</style>
```

To opt-out of this feature set `optimization.fonts: false` or `optimization.fonts.inline: false` in the browser builder options.

Example:
```js
"configurations": {
  "production": {
    "fileReplacements": [
      {
        "replace": "src/environments/environment.ts",
        "with": "src/environments/environment.prod.ts"
      }
    ],
    "optimization": {
      "fonts": false
    },
```

More information about the motivation for this feature can be found: https://github.com/angular/angular-cli/issues/18730

Note: internet access is required during the build for this optimization to work.
2020-10-14 21:57:29 +03:00
Alan Agius
d8f758758c refactor(@angular-devkit/build-angular): add disk cache to font inliner 2020-10-14 21:57:29 +03:00
Alan Agius
2e6ad9e847 build: add @types/cacache 2020-10-14 21:57:29 +03:00
Alan Agius
6ec40d3a4d feat(@angular-devkit/build-angular): add font inliner
This is the base functionality needed to inline Google fonts and Icons in HTML.

The processor does a couple of things:
1. When support for older devices is needed where woff2 is not supported it will inline definitions for both woff1 and woff2
2. Will remove comments and whitespaces when it's `minifyInlinedCSS` is enabled.
3. Cache responses so to resuse the font response during watch mode.

Note: this is still an internal implementation which users cannot leverage just yet.
2020-10-14 21:57:29 +03:00
Renovate Bot
3063abadf8 build: update css-loader to version 5.0.0 2020-10-14 10:13:07 -04:00
Renovate Bot
8fcf9fce73 build: update webpack-subresource-integrity to version 1.5.0 2020-10-14 10:12:56 -04:00
Renovate Bot
897b23a735 build: update rollup to version 2.30.0 2020-10-14 10:12:09 -04:00
Charles Lyding
a4d31fd16e refactor(@angular-devkit/build-angular): fully temporarily disable Webpack 5 license extraction 2020-10-14 10:11:02 -04:00
Renovate Bot
dbaf92386d build: update terser to version 5.3.5 2020-10-14 10:10:52 -04:00
Renovate Bot
f90084b638 build: update raw-loader to version 4.0.2 2020-10-13 12:46:53 -04:00
Bjarki
db00a24b3c feat(@angular-devkit/build-angular): support custom headers in dev-server
Make it possible to configure dev-server to send custom HTTP headers on
every client request. These headers can be specified as a key-value map
under the new "headers" property of the dev-server builder in
angular.json. These headers are then passed on to the webpack devserver.

An example use case for this is to enable various security features,
such as CSP and Trusted Types, both in local application development and
in integration tests, by setting appropriate HTTP headers.

This is part of an effort to add support for Trusted Types in Angular.
The ability to enforce Trusted Types during development and integration
tests is essential, as this can help detect Trusted Types violations
that might otherwise break applications when they're pushed to
production where such security features may be enforced.
2020-10-13 12:36:19 -04:00
Charles Lyding
755cb8dc57 test(@angular-devkit/build-angular): disable experimental Rollup size tests
The experimental Webpack Rollup pass no longer produces smaller sizes than the standard production build.
2020-10-12 11:04:14 -04:00
Renovate Bot
5e79d2998e build: update style-loader to version 2.0.0 2020-10-12 11:03:35 -04:00
Renovate Bot
afe23358e1 build: update stylus-loader to version 4.1.1 2020-10-12 11:02:36 -04:00
Renovate Bot
4a49f2a3d0 build: update source-map-loader to version 1.1.1 2020-10-12 11:02:28 -04:00
Renovate Bot
78345c56e3 build: update sass-loader to version 10.0.3 2020-10-12 11:02:17 -04:00
Renovate Bot
484ef10531 build: update postcss-loader to version 4.0.4 2020-10-12 11:00:22 -04:00
Renovate Bot
f5acc7db87 build: update less-loader to version 7.0.2 2020-10-12 11:00:13 -04:00
Renovate Bot
80b10ffd12 build: update file-loader to version 6.1.1 2020-10-12 11:00:00 -04:00
Renovate Bot
52f26af4ee build: update copy-webpack-plugin to version 6.2.1 2020-10-12 10:59:49 -04:00
Renovate Bot
9ad98d6291 build: update rollup to version 2.29.0 2020-10-09 13:14:10 -04:00
Renovate Bot
f02cff096d build: update sass to version 1.27.0 2020-10-09 13:13:55 -04:00