Skip to content

Commit 38776d8

Browse files
authored
fix: copy README.md and LICENSE just for primary entry (#215)
1 parent 2801db9 commit 38776d8

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

src/lib/ng-packagr.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
// BUILD STEP IMPLEMENTATIONS
22
import { discoverPackages } from './steps/package';
33
import { rimraf } from './util/rimraf';
4+
import { copyFiles } from './util/copy';
45
import { generateNgBundle } from './bundler';
56
import { PackageSearchResult } from './model/package-search-result';
7+
8+
// Node API
69
import * as path from 'path';
710

811
// Logging
@@ -39,6 +42,9 @@ export async function createNgPackage(opts: NgPackagrCliArguments): Promise<void
3942
await generateNgBundle(secondaryPackage);
4043
}
4144

45+
await copyFiles(`${rootPackage.sourcePath}/README.md`, rootPackage.destinationPath);
46+
await copyFiles(`${rootPackage.sourcePath}/LICENSE`, rootPackage.destinationPath);
47+
4248
log.success(`Built Angular library from ${rootPackage.sourcePath}, written to ${rootPackage.destinationPath}`);
4349
} catch (error) {
4450
// Report error messages and throw the error further up

src/lib/steps/package.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -231,9 +231,6 @@ export async function discoverPackages(rootPath: string): Promise<PackageSearchR
231231
export async function writePackage(ngPkg: NgPackageData, packageArtifacts: NgArtifacts): Promise<void> {
232232

233233
log.debug('writePackage');
234-
await copyFiles(`${ngPkg.sourcePath}/**/*.md`, ngPkg.destinationPath);
235-
await copyFiles(`${ngPkg.sourcePath}/LICENSE`, ngPkg.destinationPath);
236-
237234
const packageJson: any = await readJson(path.resolve(ngPkg.sourcePath, 'package.json'));
238235
// set additional properties
239236
for(const fieldName in packageArtifacts) {

0 commit comments

Comments
 (0)