diff --git a/src/manifest/pixiManifest.ts b/src/manifest/pixiManifest.ts index 6d07d36..bd630dd 100644 --- a/src/manifest/pixiManifest.ts +++ b/src/manifest/pixiManifest.ts @@ -122,13 +122,14 @@ function collectAssets( } const bundleAssets = localBundle.assets; - const finalAssets = asset.getFinalTransformedChildren(); if (asset.transformChildren.length > 0 && !asset.inheritedMetaData[options.tags!.mIgnore!]) { const nonIgnored = finalAssets.filter((finalAsset) => !finalAsset.inheritedMetaData[options.tags!.mIgnore!]); + if (nonIgnored.length === 0) return; + bundleAssets.push({ alias: getShortNames(stripTags(path.relative(entryPath, asset.path)), options), src: nonIgnored diff --git a/test/manifest/Manifest.test.ts b/test/manifest/Manifest.test.ts index 96dfbbf..29ae8a8 100644 --- a/test/manifest/Manifest.test.ts +++ b/test/manifest/Manifest.test.ts @@ -998,6 +998,58 @@ describe('Manifest', () => ], }); }); + + it('should ignore files with the mIgnore tag', async () => + { + const testName = 'manifest-ignore'; + const inputDir = getInputDir(pkg, testName); + const outputDir = getOutputDir(pkg, testName); + + createFolder(pkg, { + name: testName, + files: [ + { + name: '1.png', + content: assetPath('image/sp-1.png'), + }, + { + name: '2{mIgnore}.png', + content: assetPath('image/sp-1.png'), + }, + ], + folders: [], + }); + + const assetpack = new AssetPack({ + entry: inputDir, + cacheLocation: getCacheDir(pkg, testName), + output: outputDir, + cache: false, + pipes: [ + pixiManifest({ + includeMetaData: false, + }), + ], + }); + + await assetpack.run(); + + const manifest = sortObjectProperties(await fs.readJSONSync(`${outputDir}/manifest.json`)); + + expect(manifest).toEqual({ + bundles: [ + { + name: 'default', + assets: [ + { + alias: ['1.png'], + src: ['1.png'], + }, + ], + }, + ], + }); + }); }); function sortObjectProperties(obj: any)