mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-04 21:06:45 +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
|
// logic taken from CleanWebpackPlugin
|
||||||
const assets =
|
// const assets =
|
||||||
stats.toJson(
|
// stats.toJson(
|
||||||
{
|
// {
|
||||||
assets: true,
|
// assets: true,
|
||||||
},
|
// },
|
||||||
true
|
// true
|
||||||
).assets || [];
|
// ).assets || [];
|
||||||
const assetList = assets.map((asset) => asset.name);
|
// 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);
|
const emittedAssets = Array.from(compilation.emittedAssets);
|
||||||
|
|
||||||
|
if (!prevAssets.length && emittedAssets.length < assetList.length) {
|
||||||
|
emittedAssets.push(...assetList);
|
||||||
|
}
|
||||||
|
|
||||||
const staleAssets = prevAssets.filter((asset) => {
|
const staleAssets = prevAssets.filter((asset) => {
|
||||||
return assetList.includes(asset) === false;
|
return assetList.includes(asset) === false;
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user