Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: watch assets files and re-copy on changes #1660

Merged
merged 1 commit into from Jun 10, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/lib/ng-package/entry-point/write-package.transform.ts
Expand Up @@ -7,8 +7,9 @@ import { ensureUnixPath } from '../../utils/path';
import { rimraf } from '../../utils/rimraf';
import * as log from '../../utils/log';
import { globFiles } from '../../utils/glob';
import { EntryPointNode, isEntryPointInProgress, isPackage, PackageNode } from '../nodes';
import { EntryPointNode, isEntryPointInProgress, isPackage, PackageNode, fileUrl } from '../nodes';
import { copyFile } from '../../utils/copy';
import { Node } from '../../graph/node';

export const writePackageTransform: Transform = transformFromPromise(async graph => {
const entryPoint = graph.find(isEntryPointInProgress()) as EntryPointNode;
Expand Down Expand Up @@ -37,6 +38,7 @@ export const writePackageTransform: Transform = transformFromPromise(async graph
declarationFiles.map(value => {
const relativePath = path.relative(ngEntryPoint.entryFilePath, value);
const destination = path.resolve(destinationFiles.declarations, relativePath);
entryPoint.dependsOn(new Node(fileUrl(ensureUnixPath(relativePath))));
return copyFile(value, destination, { overwrite: true, dereference: true });
}),
);
Expand All @@ -55,6 +57,7 @@ export const writePackageTransform: Transform = transformFromPromise(async graph
assetFiles.map(value => {
const relativePath = path.relative(ngPackage.src, value);
const destination = path.resolve(ngPackage.dest, relativePath);
entryPoint.dependsOn(new Node(fileUrl(ensureUnixPath(relativePath))));
return copyFile(value, destination, { overwrite: true, dereference: true });
}),
);
Expand Down