Skip to content

Commit e7465c3

Browse files
committed
fix: watch assets files and re-copy on changes
Closes: #1545
1 parent bdcc938 commit e7465c3

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

‎src/lib/ng-package/entry-point/write-package.transform.ts‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,9 @@ import { ensureUnixPath } from '../../utils/path';
77
import { rimraf } from '../../utils/rimraf';
88
import * as log from '../../utils/log';
99
import { globFiles } from '../../utils/glob';
10-
import { EntryPointNode, isEntryPointInProgress, isPackage, PackageNode } from '../nodes';
10+
import { EntryPointNode, isEntryPointInProgress, isPackage, PackageNode, fileUrl } from '../nodes';
1111
import { copyFile } from '../../utils/copy';
12+
import { Node } from '../../graph/node';
1213

1314
export const writePackageTransform: Transform = transformFromPromise(async graph => {
1415
const entryPoint = graph.find(isEntryPointInProgress()) as EntryPointNode;
@@ -37,6 +38,7 @@ export const writePackageTransform: Transform = transformFromPromise(async graph
3738
declarationFiles.map(value => {
3839
const relativePath = path.relative(ngEntryPoint.entryFilePath, value);
3940
const destination = path.resolve(destinationFiles.declarations, relativePath);
41+
entryPoint.dependsOn(new Node(fileUrl(ensureUnixPath(relativePath))));
4042
return copyFile(value, destination, { overwrite: true, dereference: true });
4143
}),
4244
);
@@ -55,6 +57,7 @@ export const writePackageTransform: Transform = transformFromPromise(async graph
5557
assetFiles.map(value => {
5658
const relativePath = path.relative(ngPackage.src, value);
5759
const destination = path.resolve(ngPackage.dest, relativePath);
60+
entryPoint.dependsOn(new Node(fileUrl(ensureUnixPath(relativePath))));
5861
return copyFile(value, destination, { overwrite: true, dereference: true });
5962
}),
6063
);

0 commit comments

Comments
 (0)