Skip to content

Commit 8689481

Browse files
committed
feat(@schematics/angular): add support for watch when building a library
`ng-packagr` version `4.0.0-rc.3`, lands the incremental builds feature. More info: https://github.com/dherges/ng-packagr/blob/master/CHANGELOG.md#400-rc2-2018-06-23 `enableResourceInlining` needs to be enabled for libraries that contain components Closes: #11100
1 parent 5c5d392 commit 8689481

File tree

5 files changed

+4
-18
lines changed

5 files changed

+4
-18
lines changed

packages/schematics/angular/library/files/__projectRoot__/ng-package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
{
22
"$schema": "<%= relativePathToWorkspaceRoot %>/node_modules/ng-packagr/ng-package.schema.json",
33
"dest": "<%= relativePathToWorkspaceRoot %>/<%= distRoot %>",
4-
"deleteDestPath": false,
54
"lib": {
65
"entryFile": "src/<%= entryFile %>.ts"
76
}

packages/schematics/angular/library/files/__projectRoot__/ng-package.prod.json

Lines changed: 0 additions & 7 deletions
This file was deleted.

packages/schematics/angular/library/files/__projectRoot__/tsconfig.lib.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@
2424
"fullTemplateTypeCheck": true,
2525
"strictInjectionParameters": true,
2626
"flatModuleId": "AUTOGENERATED",
27-
"flatModuleOutFile": "AUTOGENERATED"
27+
"flatModuleOutFile": "AUTOGENERATED",
28+
"enableResourceInlining": true
2829
},
2930
"exclude": [
3031
"src/test.ts",

packages/schematics/angular/library/index.ts

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ import { latestVersions } from '../utility/latest-versions';
3535
import { validateProjectName } from '../utility/validation';
3636
import { Schema as LibraryOptions } from './schema';
3737

38-
3938
interface UpdateJsonFn<T> {
4039
(obj: T): T | void;
4140
}
@@ -107,7 +106,7 @@ function addDependenciesToPackageJson() {
107106
{
108107
type: NodeDependencyType.Dev,
109108
name: 'ng-packagr',
110-
version: '^3.0.0',
109+
version: '^4.0.0-rc.3',
111110
},
112111
{
113112
type: NodeDependencyType.Dev,
@@ -145,11 +144,6 @@ function addAppToWorkspaceFile(options: LibraryOptions, workspace: WorkspaceSche
145144
tsConfig: `${projectRoot}/tsconfig.lib.json`,
146145
project: `${projectRoot}/ng-package.json`,
147146
},
148-
configurations: {
149-
production: {
150-
project: `${projectRoot}/ng-package.prod.json`,
151-
},
152-
},
153147
},
154148
test: {
155149
builder: '@angular-devkit/build-angular:karma',

packages/schematics/angular/library/index_spec.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,6 @@ describe('Library Schematic', () => {
7373
const fileContent = getJsonFileContent(tree, '/projects/foo/ng-package.json');
7474
expect(fileContent.lib).toBeDefined();
7575
expect(fileContent.lib.entryFile).toEqual('src/my_index.ts');
76-
expect(fileContent.deleteDestPath).toEqual(false);
7776
expect(fileContent.dest).toEqual('../../dist/foo');
7877
});
7978

@@ -138,7 +137,7 @@ describe('Library Schematic', () => {
138137
const tree = schematicRunner.runSchematic('library', defaultOptions, workspaceTree);
139138

140139
const packageJson = getJsonFileContent(tree, 'package.json');
141-
expect(packageJson.devDependencies['ng-packagr']).toEqual('^3.0.0');
140+
expect(packageJson.devDependencies['ng-packagr']).toEqual('^4.0.0-rc.3');
142141
expect(packageJson.devDependencies['@angular-devkit/build-ng-packagr'])
143142
.toEqual(latestVersions.DevkitBuildNgPackagr);
144143
});

0 commit comments

Comments
 (0)