198 Commits

Author SHA1 Message Date
Alan Agius
93e253bc93 refactor: rename tsconfig.json to tsconfig.base.json 2020-05-20 12:12:33 -07:00
Alan Agius
0fd3c550b5 feat(@schematics/angular): update compiler options target and module settings
With this change we update the target and module settings of various compilation units.

- We replace ES5 target in protractor. Protractor runs on Node.Js which support ES2018
- For applications we now use `ES2020` instead of `ESNext` as a module to avoid unexpected changes in behaviour

This changes also adds a migration to update existing projects and also removes `module` from the Universal tsconfig as per #17352 to enable lazy loading on the server.
2020-05-06 11:42:35 -07:00
Filipe Silva
9a28114f6b test: remove non-bazel test setup 2020-04-30 15:12:46 -07:00
Filipe Silva
ef7a07050a test(@angular-devkit/build-angular): build and test with Bazel 2020-04-30 15:12:46 -07:00
Alan Agius
8fb7e586cc refactor(@angular-devkit/build-angular): remove deprecated evalSourceMap, vendorSourceMap, profile and skipAppShell options
BREAKING CHANGE:

The following deprecated devkit builders options have been removed:
- `skipAppShell:` This has no effect
- `evalSourceMap`: This done to improve performance in older versions of the CLI and is no longer needed
- `vendorSourceMap`: Use `sourceMap.vendor` instead
- `profile`: Use `NG_BUILD_PROFILING` environment variable instead
2020-04-27 15:08:15 -07:00
Charles Lyding
254994db85 fix(@angular-devkit/build-angular): ensure webpack tilde resolve behavior for stylesheet resources 2020-04-27 11:07:58 -07:00
Charles Lyding
c034477dc5 feat(@angular-devkit/build-angular): rebase relative stylesheet assets when using preprocessors
Previously, when using a preprocessor, resources (e.g., `url(./my-image.jpg)`) referenced in a stylesheet that was imported into another stylesheet would retain the exact URL.  This would be problematic as the resource would not be at the relative location within the new combined stylesheet.  With this change the resource URLs will now be adjusted to reference the origin location of the resource.  This allows the resources to be found without any additional changes to the application or build process.
CSS and Less already functioned in this manner. This change brings Sass and Stylus to parity.

Fixes: #12797
2020-04-27 11:07:58 -07:00
Charles Lyding
06e9955743 test(@angular-devkit/build-angular): ensure autoprefixed global CSS imports 2020-04-27 11:07:58 -07:00
Alan Agius
710cf5656e fix(@angular-devkit/build-angular): retain css declarations order when using extractCss and @import rule
Relevant code:
239e43d1f3/src/plugins/postcss-import-parser.js (L9)

239e43d1f3/src/index.js (L132-L150)

Fixes #9475
2020-04-10 09:56:55 -07:00
Alan Agius
10e7eb2c24 test: change browserslist file name to .browserslistrc 2020-04-06 09:58:42 -07:00
Alan Agius
b7a612f14a feat(@schematics/angular): change browserslist file name to .browserslistrc
Closes: #15961
2020-04-06 09:58:42 -07:00
Alan Agius
ea11c5549a feat(@angular-devkit/build-angular): show warnings when depending on CommonJS.
Depending on CommonJS modules is know to cause optimization bailouts. With this change when running a browser build and scripts optimization is enabled we display a warning.

To suppress the warning for a particular package, users can use the `allowedCommonJsDepedencies` builder options.

Example:
```
"build": {
  "builder": "@angular-devkit/build-angular:browser",
  "options": {
    ...
    "allowedCommonJsDepedencies": ["bootstrap"]
  },
}
```

Reference: TOOL-1328
2020-03-23 14:20:21 -07:00
Wojciech Okoński
237bade5d5 fix(@angular-devkit/build-angular): add missing styles extensions in anyComponentStyle budget
Make anyComponentStyle budged work with all style extensions. Previously it was working only with css styles. Files with other extensions were ignored.
2020-03-16 21:43:44 -07:00
Alan Agius
d29d40370a fix(@angular-devkit/build-angular): fix autoprefixer comments support in scss
Change Scss output style to `expanded` as otherwise sass will remove comments that are needed for autoprefixer when webpack is in prod mode because of the following implementation in `sass-loader`:
See: 45ad0be172/src/getSassOptions.js (L68-L70)

Fixes #17041
2020-02-24 12:52:12 -08:00
Alan Agius
9b7b2f0047 fix(@ngtools/webpack): add local dts file as dependencies
We now add non node_modules `.d.ts` as a dependency of the main chunk. This is important under Ivy, because NG metadata is now part of the declarations files ex:

```ts
export declare class FooComponent implements OnInit {
    constructor();
    ngOnInit(): void;
    static ɵfac: i0.ɵɵFactoryDef<FooComponent>;
    static ɵcmp: i0.ɵɵComponentDefWithMeta<FooComponent, "lib-foo", never, {}, {}, never>;
}
```

Previously such files were not being added as dependency and such files didn't get invalidated when changed.

Closes #16920 and closes #16921
2020-02-18 12:44:31 -08:00
Jonathan Garvey
d6c9693952 feat(@angular-devkit/build-angular): pass "grep" and "invertGrep"
Pass the "grep" and "invertGrep" flags through to the Angular Protractor
builder as "jasmineNodeOpts" so that individual specs within an E2E test
file can be targeted.

Fixes #13020
2020-02-18 10:53:27 -08:00
Charles Lyding
6091879428 fix(@angular-devkit/build-angular): generate correct filenames when targeting ESNext
Fixes: #16906
2020-02-12 12:01:42 -08:00
Alan Agius
c3aa081ef7 fix(@angular-devkit/build-angular): add crossorigin attribute to lazy chunks
Fixes #16801
2020-02-03 17:29:58 -08:00
Filipe Silva
d463166461 fix(@ngtools/webpack): correctly determine resource dependencies
Fix #16569
2020-01-23 18:01:03 -08:00
Charles Lyding
9a7d8e3877 fix(@angular-devkit/build-angular): ensure output is ASCII only
Fixes: #16721
2020-01-23 18:00:04 -08:00
Alan Agius
bcfccc93f8 test: refactor web-worker to wait for filesystem to be fully settled 2020-01-16 14:48:23 -08:00
Alan Agius
f1ffb106b2 fix(@angular-devkit/build-angular): emit error when a script is not found
While we currently invoke the `callback` with the error in d4f1ff82c5/packages/angular_devkit/build_angular/src/angular-cli-files/plugins/scripts-webpack-plugin.ts (L163) this is not bubbled up to the main webpack compilation due to the usage of `thisCompilation`.

Closes #16659
2020-01-15 11:31:09 -08:00
Alan Agius
e9897de7ae fix(@angular-devkit/build-angular): change css optimizer from clean-css with cssnano
Closes #16123 and closes #13854
2020-01-13 09:46:15 -08:00
Alan Agius
0659cf09e3 fix(@angular-devkit/build-angular): add externalDependencies to server builders
Certain node packages depend on native bindings which cannot be bundled, with this fix we add a way to exclude these from being processed by the bundler.

Closes: #16348
2019-12-05 18:53:08 -08:00
Alan Agius
0a7ace3595 fix(@angular-devkit/build-angular): allow bundleDependencies to be a boolean 2019-12-05 18:53:08 -08:00
Filipe Silva
3079b06bd0 test: re-enable ivy aot rebuild test 2019-12-02 12:50:14 -08:00
FDIM
2c0efd834b fix(@angular-devkit/build-angular): mocked context in single test transform matches webpack API 2019-11-23 10:35:45 +02:00
Charles Lyding
cfc0aa4780 fix(@angular-devkit/build-angular): properly process es2016+ targets with differential loading
A target of es2015 was previously assumed when using differential loading.  This could result in erroneously downleveling an es2016+ output file instead of generating a new es5 output file.
2019-11-20 13:21:58 -08:00
Filipe Silva
bf39e74e7f fix(@ngtools/webpack): fix rebuilds for transitive and global type deps
Fix #15856
2019-11-19 11:40:58 -08:00
Filipe Silva
8a0f92bd83 fix(@ngtools/webpack): recursive look up unused files
Fix #15626
2019-11-12 11:48:41 -08:00
Filipe Silva
9b91163c52 fix(@ngtools/webpack): don't warn on unused ngsummary
Fix https://github.com/angular/angular-cli/issues/15626#issuecomment-551632356
2019-11-12 11:48:41 -08:00
Filipe Silva
d438cf0f45 test: increase debounce time for rebuild tests 2019-11-05 16:40:37 -08:00
Alan Agius
0f3587173a test: verify that link in outputpath is not deleted at source
Closes: #15183
2019-11-05 16:39:14 -08:00
Alan Agius
588baa5737 fix(@angular-devkit/build-angular): i18n app shell with Ivy 2019-10-30 09:36:14 -07:00
Alan Agius
77a4fba45f fix(@angular-devkit/build-angular): don't emit CSS resources during a server build
The server should serve the assets emitted by the browser builder. In fact the nguniversal schematics are configured to serve the assets from the browser folder
a0cc9ab97a/modules/express-engine/schematics/install/files/__serverFileName%40stripTsExtension__.ts (L26)

Closes #12878
2019-10-29 20:21:24 -07:00
Charles Lyding
dd4bc23a48 fix(@angular-devkit/build-angular): keep licenses if extraction is disabled 2019-10-25 15:22:26 -07:00
Alan Agius
f943d3a8dc refactor(@angular-devkit/build-angular): rename ngModuleDef to ɵmod 2019-10-16 05:56:23 -07:00
Alan Agius
e847ee5c83 fix(@angular-devkit/build-angular): change the ngComponentDef to ɵcmp
Related to 64fd0d6db9
2019-10-16 05:56:23 -07:00
Alan Agius
d9bf2dbbda fix(@angular-devkit/build-angular): avoid attempting to copy directories
Avoid copying directly directories, also which this change we cache `fs.existsSync` to optimize copying when a lot of file are being copied to the same destination.

Closes: #15816
2019-10-11 13:53:48 -07:00
Filipe Silva
47490527ff feat(@angular-devkit/build-angular): add experimentalRollupPass (#15690)
In applications that make heavy use of lazy routes and ES2015 libraries, this option can improve bundle sizes. It might also break your bundles in ways we don't understand fully, so please test and report any problems you find.

NOTE: the following are known problems with experimentalRollupPass
- vendorChunk, commonChunk, namedChunks: these won't work, because by the time webpack sees the chunks, the context of where they came from is lost.
- webWorkerTsConfig: workers must be imported via a root relative path (e.g.`app/search/search.worker`) instead of a relative path (`/search.worker`) because of the same reason as above.
- loadChildren string syntax: doesn't work because rollup cannot follow the imports.
2019-10-10 12:39:38 -07:00
Alan Agius
c3169ae7d2 New i18n schema (#15760)
* feat(@angular-devkit/core): update schema to support new i18n options

"projects": {
  "my-app": {
    "projectType": "application",
    "schematics": {},
    "root": "",
    "i18n": {
      "sourceLocale": "en-US",
      "locales": {
        "fr": "src/locale/messages.fr.xlf"
      }
    },
    "sourceRoot": "src",
    ...
  }
}

* feat(@angular-devkit/build-angular): add new i18n options to browser and server builders

With this change we add `translateLocales` as new options for i18n in browser and server builders.

We also deprecate the following options;
* i18nLocale
* i18nFormat
* i18nFile

* feat(@angular-devkit/build-angular): deprecate `i18nFormat` and `i18nLocale` options of `extract-i18n` builder

Option `i18nFormat` has been deprecated in favor of `format` and `i18nLocale` option has been deprecated in favor of the `sourceLocale` sub option of the `i18n` project level option.

* feat(@angular/cli): add alias of `i18n-extract` for `x18n` command

* refactor: rename `translateLocales` to `localize`
2019-10-10 12:39:00 -07:00
Alan Agius
4d2ef2bf57 feat(@angular-devkit/build-angular): add support for i18n extraction with Ivy (#15796)
Re-enable i18n extraction in Ivy by using the legacy VE compiler.
2019-10-09 11:04:48 -07:00
Alan
fb0a6af9f0 fix(@angular-devkit/build-angular): make app-shell work with Ivy
Fixes #15383
2019-09-10 10:01:50 -07:00
noeri
366e51be04 feat(@angular-devkit/build-angular): expose webpack-dev-server's allowedHosts option
Closes #13656
2019-09-09 14:09:58 -07:00
Alan Agius
2c8b12f45c feat(@angular-devkit/build-angular): update sass-loader to 8.0.0
Full list of changes https://github.com/webpack-contrib/sass-loader/blob/master/CHANGELOG.md#800-2019-08-29
2019-09-05 00:24:32 +05:30
Filipe Silva
6a29ce47a1 test: add issue for broken app-shell test 2019-08-30 22:53:46 +05:30
Filipe Silva
ecc9d0e2b5 test: update server builder specs 2019-08-30 22:53:46 +05:30
Filipe Silva
77cb0d3f41 test: add issue for disabled Ivy AOT rebuild test 2019-08-30 22:53:46 +05:30
Filipe Silva
430e75978a test: re-enable lazy route error tests for Ivy 2019-08-30 22:53:46 +05:30
Filipe Silva
45155dc489 test: fix external source map test for Ivy 2019-08-30 22:53:46 +05:30