minista 2.4.3 → 2.4.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.d.ts +0 -2
- package/dist/build.js +4 -12
- package/dist/esbuild.js +1 -1
- package/dist/generate.js +1 -3
- package/package.json +1 -1
package/dist/build.d.ts
CHANGED
|
@@ -25,7 +25,6 @@ export declare function buildTempAssets(viteConfig: InlineConfig, buildOptions:
|
|
|
25
25
|
bundleOutName: string;
|
|
26
26
|
outDir: string;
|
|
27
27
|
assetDir: string;
|
|
28
|
-
generateJs: boolean;
|
|
29
28
|
}): Promise<void>;
|
|
30
29
|
export declare function buildAssetsTagStr(entryPoints: string[], buildOptions: {
|
|
31
30
|
outBase: string;
|
|
@@ -57,7 +56,6 @@ export declare function buildPartialHydrateAssets(viteConfig: InlineConfig, buil
|
|
|
57
56
|
bundleOutName: string;
|
|
58
57
|
outDir: string;
|
|
59
58
|
assetDir: string;
|
|
60
|
-
generateJs: boolean;
|
|
61
59
|
usePreact: boolean;
|
|
62
60
|
}): Promise<void>;
|
|
63
61
|
export declare function buildCopyDir(targetDir: string, outDir: string, log?: "public" | "assets"): Promise<void>;
|
package/dist/build.js
CHANGED
|
@@ -181,7 +181,7 @@ async function buildHtmlPage(pageJsxContent, staticDataItem, routePath, rootStat
|
|
|
181
181
|
const staticProps = staticDataItem.props;
|
|
182
182
|
const reg1 = new RegExp(`^${outDir}|index.html`, "g");
|
|
183
183
|
const reg2 = new RegExp(`.html`, "g");
|
|
184
|
-
const pathname = routePath.replace(reg1, "").replace(reg2, "");
|
|
184
|
+
const pathname = routePath.replace(reg1, "").replace(reg2, "").replaceAll("\\", "/");
|
|
185
185
|
const location = { pathname };
|
|
186
186
|
const RenderComponent = () => {
|
|
187
187
|
if (RootComponent === Fragment) {
|
|
@@ -252,10 +252,6 @@ async function buildTempAssets(viteConfig, buildOptions) {
|
|
|
252
252
|
const customFileName = slashEnd(buildOptions.outDir) + buildOptions.bundleOutName + ".css";
|
|
253
253
|
return (item == null ? void 0 : item.source) && fs.outputFile(customFileName, item == null ? void 0 : item.source);
|
|
254
254
|
} else if (item.fileName.match(/__minista_bundle_assets\.js/)) {
|
|
255
|
-
if (buildOptions.generateJs) {
|
|
256
|
-
const customFileName = slashEnd(buildOptions.outDir) + buildOptions.bundleOutName + ".js";
|
|
257
|
-
return (item == null ? void 0 : item.code) && fs.outputFile(customFileName, item == null ? void 0 : item.code);
|
|
258
|
-
}
|
|
259
255
|
return;
|
|
260
256
|
} else {
|
|
261
257
|
const customFileName = buildOptions.outDir + item.fileName.replace(buildOptions.assetDir, "");
|
|
@@ -538,14 +534,10 @@ async function buildPartialHydrateAssets(viteConfig, buildOptions) {
|
|
|
538
534
|
if (Array.isArray(items) && items.length > 0) {
|
|
539
535
|
items.map((item) => {
|
|
540
536
|
if (item.fileName.match(/\.css/)) {
|
|
541
|
-
const customFileName = slashEnd(buildOptions.outDir) + buildOptions.bundleOutName + ".css";
|
|
542
|
-
return (item == null ? void 0 : item.source) && fs.outputFile(customFileName, item == null ? void 0 : item.source);
|
|
543
|
-
} else if (item.fileName.match(/\.js/)) {
|
|
544
|
-
if (buildOptions.generateJs) {
|
|
545
|
-
const customFileName = slashEnd(buildOptions.outDir) + buildOptions.bundleOutName + ".js";
|
|
546
|
-
return (item == null ? void 0 : item.code) && fs.outputFile(customFileName, item == null ? void 0 : item.code);
|
|
547
|
-
}
|
|
548
537
|
return;
|
|
538
|
+
} else if (item.fileName.match(/\.js/)) {
|
|
539
|
+
const customFileName = slashEnd(buildOptions.outDir) + buildOptions.bundleOutName + ".js";
|
|
540
|
+
return (item == null ? void 0 : item.code) && fs.outputFile(customFileName, item == null ? void 0 : item.code);
|
|
549
541
|
} else {
|
|
550
542
|
const customFileName = buildOptions.outDir + item.fileName.replace(buildOptions.assetDir, "");
|
|
551
543
|
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 : "";
|
package/dist/esbuild.js
CHANGED
|
@@ -96,7 +96,7 @@ function partialHydrationPlugin() {
|
|
|
96
96
|
setup(build) {
|
|
97
97
|
build.onResolve({ filter: /\?ph$/ }, (args) => {
|
|
98
98
|
return {
|
|
99
|
-
path: path.isAbsolute(args.path) ? args.path : path.join(args.resolveDir, args.path),
|
|
99
|
+
path: (path.isAbsolute(args.path) ? args.path : path.join(args.resolveDir, args.path)).replaceAll("\\", "/"),
|
|
100
100
|
namespace: "partial-hydration-loader"
|
|
101
101
|
};
|
|
102
102
|
});
|
package/dist/generate.js
CHANGED
|
@@ -65,8 +65,7 @@ async function generateTempAssets(config, viteConfig) {
|
|
|
65
65
|
input: path.resolve(__dirname + "/../dist/bundle.js"),
|
|
66
66
|
bundleOutName: config.assets.bundle.outName,
|
|
67
67
|
outDir: systemConfig.temp.assets.outDir,
|
|
68
|
-
assetDir: config.assets.outDir
|
|
69
|
-
generateJs: false
|
|
68
|
+
assetDir: config.assets.outDir
|
|
70
69
|
});
|
|
71
70
|
await buildCopyDir(systemConfig.temp.assets.outDir, slashEnd(config.out) + noSlashEnd(config.assets.outDir), "assets");
|
|
72
71
|
}
|
|
@@ -105,7 +104,6 @@ async function generatePartialHydration(config, mdxConfig, viteConfig) {
|
|
|
105
104
|
bundleOutName: config.assets.partial.outName,
|
|
106
105
|
outDir: systemConfig.temp.assets.outDir,
|
|
107
106
|
assetDir: config.assets.outDir,
|
|
108
|
-
generateJs: true,
|
|
109
107
|
usePreact: config.assets.partial.usePreact
|
|
110
108
|
});
|
|
111
109
|
}
|