468 Commits

Author SHA1 Message Date
Hans Larsen
69e4103cef feat(@angular-devkit/build-angular): add server output path 2019-03-25 10:38:42 -07:00
Hans Larsen
818bf32d68 refactor(@angular-devkit/build-angular): use quicktype of app-shell schema 2019-03-25 10:38:42 -07:00
Charles Lyding
2f791395d2 feat(@angular-devkit/build-angular): implement stable architect API for karma 2019-03-22 07:13:51 -07:00
Alan Agius
ce15899020 feat(@angular-devkit/build-angular): use sass instead of node-sass
BREAKING CHANGE: we no longer use `node-sass` by default, instead we use `sass` (dart-sass).

While in most cases this should not have an impact the generated code, dart sass has some differences from Ruby Sass. See https://github.com/sass/dart-sass#behavioral-differences-from-ruby-sass for more details

If you wish to use `node-sass` instead of `sass` you need to install node-sass as a dev dependency.

npm users
```
npm install node-sass --save-dev
```

yarn users
```
yarn add node-sass --dev
```

**Note:** for larger Sass projects to avoid this performance hit you might want to install `fibers`. See: https://www.npmjs.com/package/fibers

Ref: TOOL-748
2019-03-20 15:12:18 -07:00
Hans Larsen
2e9dc3d252 docs: add analytics dimensions for schematics flags and internal doc
The analytics.md should be kept up to date with the flags.
2019-03-20 15:08:07 -07:00
Hans Larsen
5500ad2504 feat(@angular-devkit/build-angular): add Server Builder v2
Using the new Architect API. Including moving the tests.
2019-03-19 10:07:46 -07:00
Hans Larsen
53f6b5ccfe refactor: extract the deleteOutputPath logic from the builder 2019-03-19 10:07:46 -07:00
Hans Larsen
230f491343 refactor: use quicktype for the server schema generation 2019-03-19 10:07:46 -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
Alan Agius
20a644ec4b fix(@angular-devkit/build-angular): passing port 0 when using serve will not find a suitable port
At the moment, when passing port `0` it will default to `4200` which is incorrect. `4200` should be used a baseport.
2019-03-19 09:23:08 -07:00
Charles Lyding
a49d278baa feat(@angular-devkit/build-angular): implement stable architect API for protractor 2019-03-19 09:17:15 -07:00
Alan Agius
330e56ed6d feat(@angular-devkit/build-angular): deprecate profile option in build
This flag has been deprecated in favor of the `NG_BUILD_PROFILING`  environment variable. This is mainly due not to expose debugging flag in our API.
2019-03-15 16:06:15 -07:00
Charles Lyding
ebf90b3d6a refactor(@angular-devkit/build-angular): remove unused host parameter from typescript webpack methods 2019-03-13 13:55:26 -07:00
Charles Lyding
8644608987 refactor(@angular-devkit/build-angular): remove redundant getNonAotTestConfig function
The `getNonAotConfig` and `getNonAotTestConfig` functions are equivalent in regards to behavior.  The `extract` optional parameter for `_createAotPlugin` is false by default.
2019-03-13 13:55:26 -07:00
Olivier Combe
3d8064bb64 feat(@angular-devkit/build-angular): remove Closure compiler i18n code for ivy
For runtime i18n with ivy we generate code for both Closure compiler (used at Google) and for external people that don't use Closure compiler.
We added a new global flag named `ngI18nClosureMode` that allows uglify (and Closure compiler) to effectively tree-shake all of the code that isn't used in the current setup.
By default we remove all of the Closure compiler code because we assume that it won't be used.
2019-03-13 13:55:07 -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
Hans Larsen
cf5e3b19b6 feat(@angular-devkit/build-angular): move dev-server to new API
Includes moving all the tests.
2019-03-13 13:51:22 -07:00
Hans Larsen
6a0b3fe6b2 feat(@angular-devkit/build-angular): re-export schemas
When we moved to using QuickType to generate those we removed those
exports. That was an unfortunate breaking change.
2019-03-11 13:48:01 -07:00
Hans Larsen
78a4149384 feat(@angular-devkit/build-angular): browserTarget should match target pattern 2019-03-11 13:48:01 -07:00
Hans Larsen
890cfbe7c7 fix(@angular-devkit/build-angular): fail the build if service worker fails
Its the sensible thing to do.
2019-03-11 13:48:01 -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
Alan
901042d95b fix(@angular-devkit/build-angular): fix check for absolute paths in windows in server config
This changes fixes `Error: You must pass in a NgModule or NgModuleFactory to be bootstrapped`.

At the moment the check for absolute path is not correct for windows.

Fixes #13865 and fixes https://github.com/angular/universal/issues/1139
2019-03-11 13:40:38 -07:00
Alan
309b4838c3 fix(@angular-devkit/build-angular): don't bundle linked modules when bundleDependencies in none in server builder
Fixes #13817
2019-03-06 11:29:51 -08:00
Alan Agius
320273af5a feat(@angular-devkit/build-angular): add support for tslint 5.13+
Tslint 5.13+ introduced an addition parameter for the format method, mainly used for check-style formatter.

During runtime users using an older version of tslint that doesn't expose this it is not a problem as this parameter will be ignored.

See: 9000479b69
2019-03-06 11:28:37 -08:00
Hans Larsen
61adf9ae35 refactor(@angular-devkit/build-angular): remove useless variable rename 2019-03-06 10:05:31 -08:00
Hans Larsen
e8dab635ff feat(@angular-devkit/build-angular): add Browser Builder v2
It exposes a lot of functions that can be reused to run webpack with
different config, so third party builders can reuse those.
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
Charles Lyding
2f4602db08 feat(@angular-devkit/build-angular): change es5BrowserSupport output filename to polyfills.es5.js
Closes #13808
2019-03-04 09:36:00 -08:00
Alan Agius
70b28193c9 fix(@angular-devkit/build-angular): sourceMap option not working in tests
Fixes #13766
2019-02-26 08:37:49 -08:00
Alan Agius
ae13974f1d build: update to rxjs 6.4 2019-02-26 08:33:48 -08:00
Rares Matei
f03c44c841 fix(@angular-devkit/build-angular): add promise polyfill to --es5BrowserSupport provided polyfills
Since Angular uses Promises, we need to provide a polyfill for it to support ES5 only browsers.
2019-02-22 15:52:20 -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
4751fc02d4 fix(@angular-devkit/build-angular): improve webpack loader resolution
Previously, all loaders either needed to be in the workspace's node modules directory or a node modules directory directly within the build angular package.  A package manager can potentially hoist a loader to a node modules location inbetween the two and causing loader resolution to fail.  This change causes webpack to check all intermediate node modules directories in addition to the initial two locations.
2019-02-19 13:56:35 -08:00
hrocha16
05e2a0eafe fix(@angular-devkit/build-angular): minimum threshold 2019-02-19 13:56:07 -08:00
Hans Larsen
df1b56c251 feat(@angular-devkit/build-angular): move tslint to new API
It is only new files and the old builder is still available. The new
one can only be used by the new Architect API.
2019-02-19 13:51:29 -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
5016843c39 style(@angular-devkit/build-angular): remove comment reference to eject 2019-02-15 15:09:11 -08:00
Alan
daab547731 docs: remove analyse link from statsJson description
https://webpack.github.io/analyse has been broken for over a year and it seems that it is no longer maintained.

See  https://github.com/webpack/analyse/issues/30

Closes #10589
2019-02-13 15:26:12 -08:00
hrocha16
b611e7fc58 fix(@angular-devkit/build-angular): added warning for ES2017 2019-02-13 15:20:41 -08:00
Charles Lyding
af88936ef5 fix(@angular-devkit/build-angular): remove unneeded script element type 2019-02-13 15:20:15 -08:00
Alan
1efc9d29af fix(@angular-devkit/build-angular): throw error when multiple bundles have been name the same
Naming more than 1 bundle with the same name might cause undefined behavior.

Fixes #13568
2019-02-13 15:19:01 -08:00
Alan
5415bcc6f8 refactor: deprecate protractor baseUrl option from builder
Users should use baseUrl property in the Protractor config file
2019-02-08 16:09:30 -08:00
Alan
8252f20615 fix(@angular-devkit/build-angular): error when both baseUrl and devServerTarget are used in protractor
Users cannot use both baseUrl and devServerTarget, and the later superseeds the baseUrl.

Fixes #13611
2019-02-08 16:09:30 -08:00
Alan
7bc2e396d3 refactor: change error message to use option name instead of args 2019-02-08 16:09:30 -08:00
Filipe Silva
e6f96fb744 fix(@angular-devkit/build-angular): use sourcemap object in karma plugin (#13584)
Followup to https://github.com/angular/angular-cli/pull/13062

Fix https://github.com/angular/angular-cli/issues/13580
2019-02-05 21:15:49 -08:00
Alan Agius
290b68c03a fix(@angular-devkit/build-angular): add missing open parenthesis in stacktrace (#13565)
Fixes #13558
2019-02-05 21:14:54 -08:00
clydin
fa6795a847 Fully resolve correct @ngtools/webpack loader (#13549)
* refactor(@ngtools/webpack): support import-based loader resolution

* fix(@angular-devkit/build-angular): ensure correct ngtools loader version

By using the the direct import approach, the loader will be guaranteed to originate from the same package version/location as the other `@ngtools/webpack` imports.

Fixes #13539
2019-02-05 21:12:31 -08:00
Alan
0c65664f03 fix(@angular-devkit/build-angular): error only when file is not found in non of the programs
At the moment, if a user provides multiple tsconfig, a file needs to be part of all compilations as otherwise it will fail.

This PR changes this behavour and as long as it's in one of the compilations it will not error out.

Fixes #13399
2019-01-23 10:12:22 -08:00
Filipe Silva
d536df95f2 feat(@angular-devkit/build-angular): update webpack to 4.29
This version (https://github.com/webpack/webpack/releases/tag/v4.29.0) includes a memory leak fix for assets (https://github.com/webpack/webpack/pull/8609, https://github.com/webpack/webpack/pull/8642).

Thanks to @meligy for pinging about this!
2019-01-22 09:39:19 -08:00