minista 2.8.3 → 2.8.4
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/config.js +5 -6
- package/dist/types.d.ts +1 -1
- package/dist/vite.d.ts +1 -1
- package/dist/vite.js +8 -2
- package/package.json +1 -1
package/dist/config.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import React from "react";
|
|
3
3
|
import { deepmergeCustom } from "deepmerge-ts";
|
|
4
4
|
import { systemConfig } from "./system.js";
|
|
5
|
-
import { slashEnd, noSlashEnd, noSlashStart
|
|
5
|
+
import { slashEnd, noSlashEnd, noSlashStart } from "./utils.js";
|
|
6
6
|
const defaultConfig = {
|
|
7
7
|
base: "/",
|
|
8
8
|
public: "public",
|
|
@@ -164,7 +164,6 @@ async function resolveEntry(entry) {
|
|
|
164
164
|
return;
|
|
165
165
|
} else if (typeof input === "string") {
|
|
166
166
|
const pattern = {
|
|
167
|
-
name: getFilename(input),
|
|
168
167
|
input: noSlashStart(input),
|
|
169
168
|
insertPages: ["**/*"]
|
|
170
169
|
};
|
|
@@ -174,7 +173,6 @@ async function resolveEntry(entry) {
|
|
|
174
173
|
const strArray = input;
|
|
175
174
|
await Promise.all(strArray.map(async (item) => {
|
|
176
175
|
const pattern = {
|
|
177
|
-
name: getFilename(item),
|
|
178
176
|
input: noSlashStart(item),
|
|
179
177
|
insertPages: ["**/*"]
|
|
180
178
|
};
|
|
@@ -183,15 +181,16 @@ async function resolveEntry(entry) {
|
|
|
183
181
|
} else {
|
|
184
182
|
const objectArray = input;
|
|
185
183
|
await Promise.all(objectArray.map(async (item) => {
|
|
186
|
-
const name = item.name || getFilename(item.input);
|
|
187
184
|
const include = getInsertPagesInclude(item.insertPages);
|
|
188
185
|
const exclude = getInsertPagesExclude(item.insertPages);
|
|
189
186
|
const fixedExclude = exclude.map((item2) => "!" + item2);
|
|
190
|
-
|
|
191
|
-
name,
|
|
187
|
+
let pattern = {
|
|
192
188
|
input: noSlashStart(item.input),
|
|
193
189
|
insertPages: [...include, ...fixedExclude]
|
|
194
190
|
};
|
|
191
|
+
if (item.name) {
|
|
192
|
+
pattern.name = item.name;
|
|
193
|
+
}
|
|
195
194
|
return entries.push(pattern);
|
|
196
195
|
}));
|
|
197
196
|
}
|
package/dist/types.d.ts
CHANGED
package/dist/vite.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ import type { MinistaResolveConfig, MinistaCliDevOptions, MinistaCliPreviewOptio
|
|
|
7
7
|
export declare function getViteConfig(config: MinistaResolveConfig, mdxConfig: MdxOptions, cliOptions?: MinistaCliDevOptions | MinistaCliPreviewOptions): Promise<ViteConfig>;
|
|
8
8
|
export declare function resolveEntry(entry: EntryObject[]): {
|
|
9
9
|
[key: string]: string;
|
|
10
|
-
} | string;
|
|
10
|
+
} | string[] | string;
|
|
11
11
|
export declare function resolveaAssetFileName(chunkInfo: PreRenderedAsset, config: MinistaResolveConfig): string;
|
|
12
12
|
export declare function vitePluginMinistaVirtualHtml({ entry, }: {
|
|
13
13
|
entry: EntryObject[];
|
package/dist/vite.js
CHANGED
|
@@ -112,8 +112,14 @@ function resolveEntry(entry) {
|
|
|
112
112
|
if (!entry.length) {
|
|
113
113
|
return "";
|
|
114
114
|
}
|
|
115
|
-
const
|
|
116
|
-
|
|
115
|
+
const hasName = entry.every((item) => item.name);
|
|
116
|
+
if (hasName) {
|
|
117
|
+
const entries = Object.fromEntries(entry.map((item) => [item.name, item.input]));
|
|
118
|
+
return entries;
|
|
119
|
+
} else {
|
|
120
|
+
const entries = entry.map((item) => item.input);
|
|
121
|
+
return entries;
|
|
122
|
+
}
|
|
117
123
|
}
|
|
118
124
|
function resolveaAssetFileName(chunkInfo, config) {
|
|
119
125
|
const imgExt = ["jpg", "jpeg", "gif", "png", "webp"];
|