Skip to content

Commit

Permalink
fix watch command (#28)
Browse files Browse the repository at this point in the history
  • Loading branch information
Zyie authored Mar 2, 2023
1 parent f03cb8e commit eb95c21
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
17 changes: 16 additions & 1 deletion packages/core/src/Processor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { SavableAssetCache } from './Cache';
import type { ReqAssetPackConfig } from './config';
import { Logger } from './logger/Logger';
import type { Plugin } from './Plugin';
import { hasTag, replaceExt } from './utils';
import { hasTag, path, replaceExt } from './utils';

interface SaveOptions<T extends RootTree | TransformedTree>
{
Expand Down Expand Up @@ -300,6 +300,21 @@ export class Processor

if (SavableAssetCache.has(tree.path))
{
const asset = SavableAssetCache.get(tree.path);

if (asset.transformData?.files.length > 0)
{
asset.transformData.files.forEach((file) =>
{
file.paths.forEach((shortPath) =>
{
const fullPath = path.join(this.config.output, shortPath);

// eslint-disable-next-line @typescript-eslint/no-unused-expressions
fs.existsSync(fullPath) && fs.removeSync(fullPath);
});
});
}
SavableAssetCache.remove(tree.path);
}
}
Expand Down
3 changes: 3 additions & 0 deletions packages/manifest/src/pixi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,9 @@ function collect(
options: PixiManifestOptions
)
{
// an item may have been deleted, so we don't want to add it to the manifest!
if (tree.state === 'deleted') return;

const targetPath = getManifestName(tree.path, processor.config.entry) || 'default';

if (!bundles.has(targetPath))
Expand Down

0 comments on commit eb95c21

Please sign in to comment.