perf: optimize the diffPreferences logic and adjust the unit test (#4130)
This commit is contained in:
@@ -80,7 +80,7 @@ async function viteImportMapPlugin(
|
||||
const firstLayerKeys = Object.keys(scopes);
|
||||
const inputMapScopes: string[] = [];
|
||||
firstLayerKeys.forEach((key) => {
|
||||
inputMapScopes.push(...Object.keys(scopes[key]));
|
||||
inputMapScopes.push(...Object.keys(scopes[key] || {}));
|
||||
});
|
||||
const inputMapImports = Object.keys(imports);
|
||||
|
||||
@@ -160,7 +160,10 @@ async function viteImportMapPlugin(
|
||||
options.defaultProvider || DEFAULT_PROVIDER,
|
||||
);
|
||||
|
||||
const resultHtml = await injectShimsToHtml(html, esModuleShimsSrc);
|
||||
const resultHtml = await injectShimsToHtml(
|
||||
html,
|
||||
esModuleShimsSrc || '',
|
||||
);
|
||||
html = await minify(resultHtml || html, {
|
||||
collapseWhitespace: true,
|
||||
minifyCSS: true,
|
||||
|
@@ -16,8 +16,8 @@ function resolvePackageVersion(
|
||||
async function resolveMonorepoDependencies() {
|
||||
const { packages } = await getPackages();
|
||||
|
||||
const resultDevDependencies: Record<string, string> = {};
|
||||
const resultDependencies: Record<string, string> = {};
|
||||
const resultDevDependencies: Record<string, string | undefined> = {};
|
||||
const resultDependencies: Record<string, string | undefined> = {};
|
||||
const pkgsMeta: Record<string, string> = {};
|
||||
|
||||
for (const { packageJson } of packages) {
|
||||
|
Reference in New Issue
Block a user