mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +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