Skip to content

Commit

Permalink
fix: watch assets files and re-copy on changes
Browse files Browse the repository at this point in the history
Closes: #1545
  • Loading branch information
alan-agius4 committed Jun 10, 2020
1 parent bdcc938 commit e7465c3
Showing 1 changed file with 4 additions and 1 deletion.
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

0 comments on commit e7465c3

Please sign in to comment.