fix(bazel): ng-new should run yarn install (#28381)

yarn install was disabled in ng-new for Bazel schematics because
Bazel manages its own node_modules dependencies and therefore
there is no need to install dependencies twice.

However, the first yarn install is needed for `ng` commands to work,
most notably `ng build`.

This commit restores the original behavior.

PR Close #28381
This commit is contained in:
Keen Yee Liau 2019-01-25 14:43:36 -08:00 committed by Jason Aden
parent f7c551e16b
commit 3b48d13af8
2 changed files with 5 additions and 5 deletions

View File

@ -10,7 +10,6 @@ function testBazel() {
ng new demo --collection=@angular/bazel --defaults --skip-git
node replace_angular_repo.js "./demo/WORKSPACE"
cd demo
yarn install
cp ../package.json.replace ./package.json
ng build
ng test

View File

@ -201,10 +201,11 @@ export default function(options: Schema): Rule {
validateProjectName(options.name);
return chain([
externalSchematic('@schematics/angular', 'ng-new', {
...options,
skipInstall: true,
}),
externalSchematic(
'@schematics/angular', 'ng-new',
{
...options,
}),
addDevDependenciesToPackageJson(options),
addDevAndProdMainForAot(options),
schematic('bazel-workspace', options),