110 Commits

Author SHA1 Message Date
Charles Lyding
9edb30cf2c fix(@angular/cli): only install packages once for a new project 2017-08-18 10:15:44 -07:00
Charles Lyding
36ceacc375 fix(@angular/cli): ensure new projects have a CLI package version 2017-08-18 10:13:56 -07:00
Filipe Silva
e8f27f029a feat(@angular/cli): support sourcemaps and minification in scripts
Adds sourcemap and minification to javascript added via the `scripts` array in `.angular-cli.json`.

`script-loader` is no longer used, which should help with CSP since it used `eval`.

Scripts will no longer appear in the console output for `ng build`, as they are now assets instead of webpack entry points.

It's no longer possible to have the `output` property of both a `scripts` and a `styles` entry pointing to the same file. This wasn't officially supported or listed in the docs, but used to be possible.

Fix #2796
Fix #7226
Fix #7290

Related to #6872
2017-08-17 16:38:35 -04:00
Charles Lyding
2c6dde1941 feat(@angular/cli): add option to set dev server's base serve path 2017-08-17 14:45:45 -04:00
Filipe Silva
505d69a13c feat(@angular/cli): update license-webpack-plugin
See https://github.com/xz64/license-webpack-plugin/issues/14, https://github.com/xz64/license-webpack-plugin/issues/13.

Fix #7203
2017-08-17 13:43:51 -04:00
Mike Brocchi
128187e4c1 feat(@angular/cli): Update generate & new to use schematics
This feature is related to #6593
2017-08-16 18:24:43 -04:00
Charles Lyding
bae9d06c7d fix(@angular/cli): sync webpack stats file content options 2017-08-03 18:05:15 +01:00
christian.scharr
70cf514a28 fix(@angular/cli): exclude node_modules while take account for os specific path separators (#6870) 2017-07-31 22:51:41 +01:00
Christian Scharr
b32064f5d5 fix(@angular/cli): use relative path instead of regex to exclude node_modules (#6870) 2017-07-31 22:51:41 +01:00
Filipe Silva
138f2b8cd3 fix(@angular/cli): show warnings on serve
Errors and warnings neet to be printed separately.

Followup to #6989
Fix #7213
2017-07-31 21:17:19 +01:00
Mike Brocchi
1c7e7bc66b fix(@angular/cli): Include missing dependency when ejecting 2017-07-31 14:40:27 +01:00
Charles Lyding
bf55bfd044 fix(@angular/cli): remove deprecated json-loader 2017-07-26 21:10:57 +01:00
Hans Larsen
61b4e2202f feat(@angular/cli): rewrite stats output to properly show the asset size
This is a feature in principle; the output is changed. The stats themselves dont though.
2017-07-21 14:42:55 -04:00
FrozenPandaz
6f23636323 feat(@angular/cli): add ability to build bundle for node and export lazy route map 2017-07-20 15:01:25 -07:00
Michael Kühnel
35c89a5647 refactor: Change ejection message 2017-07-19 16:02:30 -04:00
jnizet
6ca6a5e92b fix(@angular/cli): fix doc command to work with new angular.io
- change the URL for the API search
- use google search when --search option is true, since angular.io doesn't have a search page anymore
- improve the help and doc of the doc command
2017-07-19 15:57:15 -04:00
Filipe Silva
aebf4c89b1 fix(@angular/cli): wait for install to finish before exiting 2017-07-18 10:21:41 -04:00
Filipe Silva
fe85750cb7 feat(@angular/cli): add scope hoisting via webpack 3
This should result in significant bundle size reduction. For best results, build for production with `--vendor-chunk=false`.

See https://medium.com/webpack/webpack-3-official-release-15fd2dd8f07b for details.
2017-07-10 16:59:08 -07:00
Alexandr Marchenko
b0576d6d05 fix(@angular/cli): check package manager existance before installing packages 2017-07-05 16:47:47 -07:00
Filipe Silva
5a0e80ffd3 feat(@angular/cli): name lazy chunks
Before:
```
$ ng build --no-progress
Hash: ff03df269349b817eef4
Time: 11202ms
chunk    {0} 0.chunk.js, 0.chunk.js.map 1.61 kB {1} {3} [rendered]
chunk    {1} 1.chunk.js, 1.chunk.js.map 1.46 kB {0} {3} [rendered]
chunk    {2} polyfills.bundle.js, polyfills.bundle.js.map (polyfills) 160 kB {6} [initial] [rendered]
chunk    {3} main.bundle.js, main.bundle.js.map (main) 6.38 kB {5} [initial] [rendered]
chunk    {4} styles.bundle.js, styles.bundle.js.map (styles) 10.5 kB {6} [initial] [rendered]
chunk    {5} vendor.bundle.js, vendor.bundle.js.map (vendor) 2.16 MB [initial] [rendered]
chunk    {6} inline.bundle.js, inline.bundle.js.map (inline) 0 bytes [entry] [rendered]
```

After:
```
$ ng build --no-progress
Hash: 2bc12a89f40f3b4818b5
Time: 9613ms
chunk {feature.module} feature.module.chunk.js, feature.module.chunk.js.map 1.46 kB {lazy.module} {main} [rendered]
chunk {inline} inline.bundle.js, inline.bundle.js.map (inline) 0 bytes [entry] [rendered]
chunk {lazy.module} lazy.module.chunk.js, lazy.module.chunk.js.map 1.61 kB {feature.module} {main} [rendered]
chunk {main} main.bundle.js, main.bundle.js.map (main) 6.38 kB {vendor} [initial] [rendered]
chunk {polyfills} polyfills.bundle.js, polyfills.bundle.js.map (polyfills) 160 kB {inline} [initial] [rendered]
chunk {styles} styles.bundle.js, styles.bundle.js.map (styles) 10.5 kB {inline} [initial] [rendered]
chunk {vendor} vendor.bundle.js, vendor.bundle.js.map (vendor) 2.16 MB [initial] [rendered]
```

Fix #6700
2017-07-05 14:50:52 -07:00
Filipe Silva
28e4114785 feat(@angular/cli): followup changes to circular dependency detection
Flag is now positive instead of negative and shorter, and can now be set on commands as well (`--show-circular-dependencies`).

Dependency was also added to eject as per https://github.com/angular/angular-cli/pull/6813#issuecomment-311567074.
2017-06-29 11:18:39 -07:00
Charles Lyding
3dbd3ad88e refactor(@angular/cli): remove unneeded rimraf dependency 2017-06-29 15:49:59 +01:00
Yaroslav Admin
70713bf076 feat(@angular/cli): add flag to specify environment for ng test command 2017-06-29 14:28:11 +01:00
Daniel Rönnkvist
0c6a9c5beb fix(@angular/cli): Changed init order to make sure all files gets committed
With the update of npm 5 and the introduction of package-lock.json all files weren't
committed into the first commit.
2017-06-28 14:49:05 +01:00
Reto Lehmann
0e05e5168b fix(@angular/cli): Fixed e2e task to respect --publicHost setting as baseUrl for protractor (#6266)
https://github.com/angular/angular-cli/pull/6173 added two new settings
to the serve task. The --publicHost setting is not respected as baseUrl
for protractor in the e2e-task.

With this fix, if --publicHost is set, it will be used as baseUrl for protrator.
2017-06-27 16:46:44 +01:00
Filipe Silva
1f3738b19f feat(@angular/cli): add circular dependency detection
Circular dependencies, like `app.module.ts` importing `app.component.ts` which in turn imports `app.module.ts`, now display a warning during builds:

```
kamik@T460p MINGW64 /d/sandbox/master-project (master)
$ ng build
Hash: 3516b252f4e32d6c5bb8
Time: 8693ms
chunk    {0} polyfills.bundle.js, polyfills.bundle.js.map (polyfills) 160 kB {4} [initial] [rendered]
chunk    {1} main.bundle.js, main.bundle.js.map (main) 5.95 kB {3} [initial] [rendered]
chunk    {2} styles.bundle.js, styles.bundle.js.map (styles) 10.5 kB {4} [initial] [rendered]
chunk    {3} vendor.bundle.js, vendor.bundle.js.map (vendor) 1.88 MB [initial] [rendered]
chunk    {4} inline.bundle.js, inline.bundle.js.map (inline) 0 bytes [entry] [rendered]

WARNING in Circular dependency detected:
src\app\app.module.ts -> src\app\app.component.ts -> src\app\app.module.ts

WARNING in Circular dependency detected:
src\app\app.component.ts -> src\app\app.module.ts -> src\app\app.component.ts
```

It is important to detect and eliminate circular dependencies because leaving them in might lead to `Maximum call stack size exceeded` errors, or imports being `undefined` at runtime.

To remove these warnings from your project you can factor out the circular dependency into a separate module.

For instance, if module A imports `foo` from module B, and module B imports `bar` from module A, it is enough to extract `foo` into module C.

You can turn off these warnings by running ng set apps.0.hideCircularDependencyWarnings=true. This will add the "hideCircularDependencyWarnings": true value to your .angular-cli.json and disable the warnings.

Fix #6309
Fix #6739
2017-06-27 16:30:30 +01:00
jiverson
a8e4beba54 fix(@angular/cli): glob copy plugin config 2017-06-27 16:10:37 +01:00
Bram Borggreve
b989e80626 feat(@angular/cli): allow disabling warning when --hmr flag is enabled 2017-06-19 15:29:54 -04:00
Charles Lyding
bd0dac11aa fix(@angular/cli): correct sourcemap source paths 2017-06-15 13:50:35 -04:00
Mike Brocchi
a7668e0b0c feat(@angular/cli): add barebones option to ng new
This feature allows users to specify `--barebones` (`-b`) to create a no-frills app.
2017-06-07 12:33:48 -07:00
Sumit Arora
2be0bf2d53 fix(@angular/cli): fix delete path check 2017-06-07 11:22:25 -07:00
Charles Lyding
d437afbfae fix(@angular/cli): allow public host option to accept only hostname 2017-06-07 18:44:34 +01:00
Charles Lyding
6e8944e621 fix(@angular/cli): check package manager only when using one 2017-06-06 15:08:39 +01:00
Charles Lyding
6c6d50eb0d refactor(@angular/cli): remove unnecessary use of ember-cli promise wrapper 2017-06-06 15:03:11 +01:00
Sumit Arora
e72693a948 feat(@angular/cli): remove deduped licenses 2017-06-02 19:19:44 +01:00
Charles Lyding
b72dbd9dea refactor(@angular/cli): remove additional unneeded ember-cli files 2017-06-01 11:45:01 +01:00
Hans Larsen
9c7a7ea47b fix(@angular/cli): allow node_modules to be linked somewhere else.
Fixes #6499.
2017-05-31 10:59:22 -07:00
Filipe Silva
91cbe3375f refactor(@angular/cli): use this.project instead of cliProject 2017-05-24 13:39:30 -07:00
Filipe Silva
2b2e8b3685 fix(@angular/cli): remove broken script after eject
`prepree2e` doesn't run because it's a lifecycle script for a lifecycle script, but even if it did it would not work because there is nothing coordinating the serve and e2e processes.

Users must manually initialize the server prior to running e2e tests after ejecting.

Related to https://github.com/angular/angular-cli/issues/6171
2017-05-24 15:29:32 -04:00
Sumit Arora
403bf7efb1 fix(@angular/cli): allow e2e tests to run if no-serve and port is provided 2017-05-24 15:27:27 -04:00
clydin
67fac865f8 refactor(@angular/cli): use memory FS for i18n extraction (#6306) 2017-05-17 19:19:45 -04:00
Filipe Silva
b9f8ca648d fix(@angular/cli): put vendor ngfactory in vendor chunk
Currently vendor Angular libraries will have their *.ngfactory.ts in main.ts when building with `--aot`.

The easiest way to see this is with `source-map-explorer.

This PR correctly puts them in vendor.ts.
2017-05-17 16:16:28 -07:00
Radoslav Kirilov
0e1f65c815 fix(@angular/cli): prefix historyApiFallback.index with deployUrl (#6279)
when implementing i18n following https://angular.io/docs/ts/latest/cookbook/i18n.html
and https://medium.com/@feloy/deploying-an-i18n-angular-app-with-angular-cli-fc788f17e358

when running in `development` to be consistent with `production` I am using

```
ng serve --deploy-url /en/ --base-href /en/ \
--aot --locale en --i18n-file ./src/locale/messages.en.xlf
```

running the app this way, on routes other than `http://localhost:4200/en/`
the `webpack-dev-server` was always saying that the route is not found,
so this commit fixes that
2017-05-15 10:43:21 -04:00
Filipe Silva
a54a991b2f feat(@angular/cli): add host check flags to ng serve
Two new flags are added to `ng serve`:
- `--public-host` (aliased by `--live-reload-client): Specify the URL that the browser client will use.
- `--disable-host-check`: Don't verify connected clients are part of allowed hosts.

Setting `--disable-host-check` will output a warning:
```
WARNING Running a server with --disable-host-check is a security risk. See https://medium.com/webpack/webpack-dev-server-middleware-security-issues-1489d950874a for more information.
```

See #6070 for more context about this change.

Fix #6070
2017-05-09 21:04:58 +01:00
Charles Lyding
a3bf5291e7 feat(@angular/cli): add option to use lint to adjust generated files 2017-05-09 19:04:11 +01:00
Charles Lyding
8035f54206 feat(@angular/cli): allow lint project setting to be optional 2017-05-09 19:04:11 +01:00
Ricardo Varanda
23c039d9f4 fix(@angular/cli): open option in serve command should open localhost when host is 0.0.0.0
Close #5743
2017-05-09 07:17:22 -07:00
Filipe Silva
8bf040b7e3 feat(@angular/cli): add flag to not delete output path
Fix #5925
Fix #6193
2017-05-08 14:27:59 +01:00
Tatsuyuki Ishi
3d9a7ff24d refactor(@angular/cli): use EnvironmentPlugin instead of DefinePlugin 2017-05-08 12:18:29 +01:00
Septimiu Criste
8c78fb98ef feat(@angular/cli): add publicPath support via command and angular-cli.json for webpack-dev-server
This adds support for publicPath to webpack-dev-server via ng serve
The server would have to be started like ng serve --deploy-url /deploypath --base-href /deploypath.
The app will be served from http://localhost:4200/deploypath

Should fix #2727
2017-05-04 20:32:33 +01:00