64 Commits

Author SHA1 Message Date
Charles Lyding
76492141d2 refactor(@angular-devkit/build-angular): cleanup architect imports 2019-04-03 16:28:16 +02:00
Charles Lyding
c6d145bf32 test(@angular-devkit/build-angular): cleanup unused imports 2019-04-02 10:31:24 -07:00
Filipe Silva
6e0a040ad9 refactor(@angular-devkit/build-angular): support web worker in new architect 2019-04-02 04:49:34 -07:00
Filipe Silva
ed0e6aab57 feat(@angular-devkit/build-angular): support TS web workers 2019-04-02 04:49:34 -07:00
Filipe Silva
1810394c3a test(@angular-devkit/build-angular): test worker bundling 2019-04-02 04:49:34 -07:00
Alan
7915a582cf fix(@ngtools/webpack): changes in non module code are not picked up when using barrel files
Fixes #13975
2019-03-29 14:47:03 -07:00
Charles Lyding
ba21c855c0 refactor(@angular-devkit/build-angular): cleanup stable architect API builder file names 2019-03-29 14:37:35 -07:00
Charles Lyding
1327ee3ec9 test(@angular-devkit/build-angular): update service worker browser tests to stable API 2019-03-29 14:37:35 -07:00
Charles Lyding
61717b7c27 test(@angular-devkit/build-angular): update svg browser test to stable API 2019-03-29 14:37:35 -07:00
Filipe Silva
6e3d2e0c4d feat(@ngtools/webpack): support Angular 8
This requires updating projects to TypeScript 3.3
2019-03-20 12:29:01 -07:00
Alan Agius
8f77d6711a fix(@angular-devkit/build-angular): update speed-measure-webpack-plugin to 1.3.1
This fixes the issue of it generating an empty speed-measure-plugin.json.

Fixes #12763
2019-03-19 09:28:20 -07:00
Alan Agius
f71896874e feat(@angular-devkit/build-angular): enable webpack profile when using stats-json flag
More information about what `profile` does can be found here: https://webpack.js.org/api/stats

Closes #13907
2019-03-19 09:25:28 -07:00
Hans Larsen
ef3dd70001 test: remove build-angular browser tests for old API
Move the new API tests in its place.
2019-03-15 16:05:42 -07:00
Hans Larsen
c28fb10f40 test: use toContain instead of simply true/false
It will show up better in the logs if it doesnt match.
2019-03-15 12:23:43 -07:00
Alan Agius
f70b9060d0 fix(@angular-devkit/build-angular): don't show warning when font shorthand is used
At the moment when `font` shorthand property is used a warning is emitted when using this syntax
```
font: 10px "Font Awesome";
```

This should be addressed by clean-css

Fixes #9648
2019-03-13 13:54:09 -07:00
Alan Agius
8d09594874 fix(@angular-devkit/build-angular): resolve fonts with space in filename
At the moment the uri of the font instead of spaced it will be `%20`, hence we need to decode it first before trying to resolve it.

Fixes #9648
2019-03-13 13:54:09 -07:00
Alan Agius
a24c46182f test: fix chunk in entry test 2019-03-13 13:49:49 -07:00
Alan Agius
1e3c6e3ca5 fix(@angular-devkit/build-angular): fix base href insertion when HTML is in a single line
When HTML is in a single line using offset + 1 will cause the insertion of the base href tag in the wrong possition.

Fixes #13851
2019-03-11 13:43:54 -07:00
Filipe Silva
643e83d054 feat(@schematics/angular): use esnext as the default TS module format 2019-03-06 11:29:34 -08:00
Charles Lyding
28b3042dc5 style: fix lint errors 2019-03-05 14:53:33 -08:00
Hans Larsen
eca5dc322f test(@angular-devkit/build-angular): move ALL Browser Builder tests
To the new Architect API.
2019-03-05 11:14:59 -08:00
Mathias Raacke
dfb08b95b7 feat(@ngtools/webpack): allow .svg files as templates
With directTemplateLoading enabled, components
can now use .svg files as templates. For AOT builds,
the Angular compiler host now reads .svg files
directly when reading component templates.
For JIT builds, replaceResources creates a require call
that directly uses raw-loader instead of using the
loader provided by the current webpack configuration.

Closes #10567
2019-03-05 10:16:41 -08:00
Hans Larsen
78f5c287d8 refactor(@angular-devkit/build-angular): clean up some interfaces and schemas
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.
2019-02-21 16:20:54 -08:00
Charles Lyding
94b087c9e1 fix(@angular-devkit/build-angular): disable by default stylesheet root relative URL rebasing
BREAKING CHANGE:
Root relative URLs are a standardized method to reference a resource path from the root of a host.  The previous behavior of the Angular CLI prevented this from occuring and resulted in an inability to reference stylesheet assets in this manner.  The initial reason for this behavior is no longer present in the internal implementation of the Angular CLI.  Therefore, this now unnecessary and non-standard behavior is being phased out.  If an application currently relies on this behavior, a compatibility option `rebaseRootRelativeCssUrls` has been provided for the 8.x release cycle to facilitate transition away from this non-standard and limiting behavior.  The recommended method to transition is to use relative paths within the source stylesheet.  This allows the build system to process and generate a full URL for the asset.
2019-02-19 10:14:46 -08:00
Charles Lyding
af88936ef5 fix(@angular-devkit/build-angular): remove unneeded script element type 2019-02-13 15:20:15 -08:00
調月奏
b972d57537 fix(@angular-devkit/build-angular): script chunk in angular.json return false then calling isInitial
This commit add the webpack chunk with it related chunkgroup or entrypoint
2019-01-14 12:53:52 -08:00
Alan
d10f125cc1 fix(@angular-devkit/build-angular): vendorSourceMap not being recognized when passed directly
Fixes #13414
2019-01-14 11:08:20 -08:00
Alan Agius
d8048e520b test: add test for invalid lazy routes in AOT 2019-01-08 13:38:13 -08:00
Alan Agius
36c2423042 revert: fix(@ngtools/webpack): emit lazy routes errors on rebuilds
This reverts commit edb84b340ff996df2ca6a2aaf765304cc64fef3e

The team has decided to bring back the faster but potentially less accurate method of detecting lazy routes upon JIT rebuilds (first builds will always use the more complete Angular compiler method). Applications that do not have lazy routes within libraries and that only use direct string literals with loadChildren should not be affected by the potential of less accurate detection. Note that the function overload of loadChildren also does not apply to this situation.

For those projects where correctness of lazy route detection outweighs rebuild speed, please consider using AOT mode for development. AOT mode will also provide a full set of template errors as well which JIT mode is not capable of doing.

Fixes #13102
2019-01-08 13:38:13 -08:00
Alan
5e6b42c5e3 test: add tests for elide imports
This also adds the option to provide addition files when using `createTypescriptContext` this is paramount for the elide imports tests as without this certain symbols won't have the full details.

Which will cause tests to be false positive and re-surface issues like #13212
2018-12-20 11:38:01 -08:00
Alan Agius
8bded93d8a fix(@ngtools/webpack): import as results in the alias being undefined with Typescript 3.2
When using the `specifier.propertyName` with `typeChecker.getSymbolAtLocation` it will return a more detailed symbol then we originally have in the `usedSymbols` set.

We should probably use `symbol.id` to actually check if the symbols are the same, however the `id` is not exposed in the Symbol interface.

Using `node.name` will return the same symbol that we have stored in the set.

Fixes #13212
2018-12-19 10:55:05 -08:00
Alan Agius
51f4e075db test: remove debounce as it's causing flakes 2018-12-06 11:46:58 -08:00
Alan Agius
4f8a5b7a55 feat(@angular-devkit/build-angular): fine grain settings for optimization 2018-12-06 11:44:27 -08:00
Alan Agius
8bc6e79d89 fix(@ngtools/webpack): files are not being updated when using allowJs or resolveJsonModule (#13089)
* fix(@ngtools/webpack): files are not being updated when using `allowJs` or `resolveJsonModule`

Fixes #13076 and Fixes #12964

* test: add tests for allowJs and resolveJsonModule in watch mode

* test: improve tests for `allowJs`

When not using `allowJs` js files are not processed by the tsc compiler, but still processed by webpack.

So a correct test should be to check that the JS is transpiled down to ES5 syntax.
2018-11-30 14:10:18 -08:00
Alan Agius
0692cacd06 feat(@schematics/angular): account for root level assets and resourcesOutputPath (#13074)
* feat(@schematics/angular): account for root level assets and `resourcesOutputPath`

By default we are only account for assets inside the assets folder. Which breaks the offline experience.

Fixes #13067

* test: add test to verify root level assets in service workers
2018-11-30 14:08:03 -08:00
Alan Agius
8516d68213 feat(@angular-devkit/build-angular): fine grain settings for sourceMaps (#13062)
* 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
2018-11-30 13:11:52 -08:00
Alan Agius
a38566f18e feat(@angular-devkit/build-angular): add option to allow outputting css resources to a different folder
Added `resourcesOutputPath` option so that CSS assets such as images and fonts are outputted to a subfolder in `dist`
2018-11-15 17:09:43 -08:00
Alan Agius
1dbd574714 fix(@ngtools/webpack): Fix lazy loading (#12945)
* revert: fix(@ngtools/webpack): output consistent filename

This reverts commit df172bdc8af4caa1a908592a8b9400d31c81eeb0.

* refactor(@ngtools/webpack): remove RegExp for ngfactory

This RegExp is not needed as if it actually works it will break lazy loading as in case of AOT, the name should always be suffixed with ngfactory

4c2ce4e8ba/packages/core/src/linker/system_js_ng_module_factory_loader.ts (L83)
2018-11-14 12:41:27 -08:00
Filipe Silva
e4c0151241 test(@angular-devkit/build-angular): remove unneeded flag from test 2018-11-01 10:31:50 -07:00
Alan Agius
22dc791d96 fix(@angular-devkit/build-angular): error when using protocol-relative url
Fixes #12648
2018-10-23 11:58:29 -07:00
Alan Agius
f61ea6b69f fix(@ngtools/webpack): report a warning when lazy route discovery is disabled
At the moment this will cause a runtime error instead. With this change a warning will be shown during the build.

Closes #12238 and Closes #12025
2018-10-23 11:47:55 -07:00
Alan Agius
edb84b340f fix(@ngtools/webpack): emit lazy routes errors on rebuilds (#12418)
* fix(@ngtools/webpack): emit lazy routes errors on rebuilds

At the moment lazy route errors are only emitted in the initial builds because in following builds we are only processed lazy routes that are declared in the changed files.

At the moment, we cannot cache the previously resolved routes as there is no way to track in which file the lazy route was declared so that we can bust the lazy route if it was removed.

Closes #12236

* test: add test for compilation errors in watch mode

Closes #12311
2018-10-23 10:15:35 -07:00
Alan Agius
df172bdc8a fix(@ngtools/webpack): output consistent filename
At the moment when having namedChunks file names are different between JIT and AOT builds .

AOT will will output something like
```
customers-customers-module-ngfactory.9b8b989df2e32e5cadac.js
```
while JIT will output

```
customers-customers-module.js
```

This PR aligns the output file name
2018-10-15 14:32:47 -07:00
clydin
2bdf99bad3 test: cleanup poll CLI E2E test (#12497)
* test: cleanup poll CLI E2E test

* test(@angular-devkit/build-angular): adjust poll test
2018-10-10 12:07:13 -07:00
Charles Lyding
9ef66e2a3d test(@angular-devkit/build-angular): disable flaky poll test 2018-10-05 15:01:46 -07:00
Filipe Silva
ea89f758ce test(@angular-devkit/build-angular): add test for type checker replacements 2018-10-04 13:33:24 -07:00
Alan Agius
0cfd5737ac fix(@angular-devkit/build-angular): resolve assets in styles relative to importee
Closes #12430
2018-10-03 17:34:19 -07:00
Filipe Silva
048366b3ee feat(@angular-devkit/build-angular): add profile option to browser builder
This should help users send us profile logs for builds that take too long.
2018-09-26 08:24:07 -04:00
Charles Lyding
b403aa69c1 test(@angular-devkit/build-angular): improve resilience of watch rebuilds 2018-09-10 12:30:49 -07:00
Charles Lyding
96dc506038 test(@angular-devkit/build-angular): expand polling success threshold
polling is highly dependent on CPU and IO; with shared CI machines this can cause high variability
2018-09-10 12:30:49 -07:00