Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export function handleAssets(
context: BuilderContext,
options: NgPackagrBuilderOptions,
): Observable {
const host = new NodeJsSyncHost();
const projectPath = resolve(normalize(context.workspaceRoot), normalize(path.dirname(options.project)));
const projectRoot = getSystemPath(projectPath);
return from(discoverPackages({ project: projectRoot }).then(ngPackage => {
log.info('Copying Assets');
const syncHost = new virtualFs.SyncDelegateHost(host);
if (options.assets.length === 0) {
return Promise.resolve();
}
const assets = normalizeAssetPatterns(
options.assets,
syncHost,
projectPath,
projectPath,
undefined,
);
return moveAssets(ngPackage.src, ngPackage.dest, assets);