minista 2.8.5 → 2.8.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/build.js +2 -1
- package/dist/config.js +11 -1
- package/package.json +1 -1
package/dist/build.js
CHANGED
|
@@ -316,7 +316,8 @@ async function buildTempAssets(viteConfig, buildOptions) {
|
|
|
316
316
|
} else if (item.fileName.match(/(__minista_bundle_assets\.js|\.svg$)/)) {
|
|
317
317
|
return;
|
|
318
318
|
} else {
|
|
319
|
-
|
|
319
|
+
let customFileName = buildOptions.outDir + item.fileName.replace(buildOptions.assetDir, "");
|
|
320
|
+
customFileName = customFileName.replace(/-ministaDuplicateName\d*/, "");
|
|
320
321
|
const customCode = (item == null ? void 0 : item.source) ? item == null ? void 0 : item.source : (item == null ? void 0 : item.code) ? item == null ? void 0 : item.code : "";
|
|
321
322
|
return customCode && fs.outputFile(customFileName, customCode);
|
|
322
323
|
}
|
package/dist/config.js
CHANGED
|
@@ -207,7 +207,17 @@ async function resolveEntry(entry) {
|
|
|
207
207
|
}
|
|
208
208
|
}
|
|
209
209
|
await getEntries(entry);
|
|
210
|
-
|
|
210
|
+
const entryNames = entries.map((item) => item.name);
|
|
211
|
+
const duplicateNames = entryNames.filter((value, index, self) => self.indexOf(value) === index && self.lastIndexOf(value) !== index);
|
|
212
|
+
const uniqueNameEntries = entries.map((item, index) => {
|
|
213
|
+
const name = duplicateNames.includes(item.name) ? `${item.name}-ministaDuplicateName${index}` : item.name;
|
|
214
|
+
return {
|
|
215
|
+
name,
|
|
216
|
+
input: item.input,
|
|
217
|
+
insertPages: item.insertPages
|
|
218
|
+
};
|
|
219
|
+
});
|
|
220
|
+
return uniqueNameEntries;
|
|
211
221
|
}
|
|
212
222
|
async function mergeAlias(configAlias, viteConfigAlias) {
|
|
213
223
|
const alias = [];
|