mirror of
				https://github.com/NativeScript/NativeScript.git
				synced 2025-11-04 12:58:38 +08:00 
			
		
		
		
	wip: watchstate plugin adjustments
This commit is contained in:
		
				
					committed by
					
						
						Nathan Walker
					
				
			
			
				
	
			
			
			
						parent
						
							33ab7d27b7
						
					
				
				
					commit
					a6d19e9716
				
			@ -55,16 +55,24 @@ export class WatchStatePlugin {
 | 
			
		||||
			}
 | 
			
		||||
 | 
			
		||||
			// logic taken from CleanWebpackPlugin
 | 
			
		||||
			const assets =
 | 
			
		||||
				stats.toJson(
 | 
			
		||||
					{
 | 
			
		||||
						assets: true,
 | 
			
		||||
					},
 | 
			
		||||
					true
 | 
			
		||||
				).assets || [];
 | 
			
		||||
			const assetList = assets.map((asset) => asset.name);
 | 
			
		||||
			// const assets =
 | 
			
		||||
			// 	stats.toJson(
 | 
			
		||||
			// 		{
 | 
			
		||||
			// 			assets: true,
 | 
			
		||||
			// 		},
 | 
			
		||||
			// 		true
 | 
			
		||||
			// 	).assets || [];
 | 
			
		||||
			// const assetList = assets.map((asset) => asset.name);
 | 
			
		||||
 | 
			
		||||
			// const emittedAssets = Array.from(compilation.emittedAssets);
 | 
			
		||||
 | 
			
		||||
			const assetList = Object.keys(compilation.assets);
 | 
			
		||||
			const emittedAssets = Array.from(compilation.emittedAssets);
 | 
			
		||||
 | 
			
		||||
			if (!prevAssets.length && emittedAssets.length < assetList.length) {
 | 
			
		||||
				emittedAssets.push(...assetList);
 | 
			
		||||
			}
 | 
			
		||||
 | 
			
		||||
			const staleAssets = prevAssets.filter((asset) => {
 | 
			
		||||
				return assetList.includes(asset) === false;
 | 
			
		||||
			});
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user