minista 2.3.1 → 2.3.2
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 +4 -2
- package/dist/vite.js +3 -1
- package/package.json +1 -1
package/dist/build.js
CHANGED
|
@@ -33,7 +33,9 @@ import { slashEnd } from "./utils.js";
|
|
|
33
33
|
const __filename = url.fileURLToPath(import.meta.url);
|
|
34
34
|
const __dirname = path.dirname(__filename);
|
|
35
35
|
async function buildTempPages(entryPoints, buildOptions) {
|
|
36
|
-
const
|
|
36
|
+
const ministaPkgUrl = path.resolve(__dirname + "/../package.json");
|
|
37
|
+
const ministaPkgUrlRelative = path.relative(".", ministaPkgUrl);
|
|
38
|
+
const ministaPkg = JSON.parse(fs.readFileSync(ministaPkgUrlRelative, "utf8"));
|
|
37
39
|
const userPkgPath = path.resolve("package.json");
|
|
38
40
|
const userPkgFilePath = path.relative(process.cwd(), userPkgPath);
|
|
39
41
|
const userPkg = JSON.parse(fs.readFileSync(userPkgFilePath, "utf8"));
|
|
@@ -222,7 +224,7 @@ async function buildTempAssets(viteConfig, buildOptions) {
|
|
|
222
224
|
async function buildAssetsTagStr(entryPoints, buildOptions) {
|
|
223
225
|
const winOutBase = buildOptions.outBase.replaceAll("/", "\\");
|
|
224
226
|
const assetsTags = entryPoints.map((entryPoint) => {
|
|
225
|
-
const assetPath = entryPoint.replace(buildOptions.outBase, buildOptions.outDir).replace(winOutBase, buildOptions.outDir);
|
|
227
|
+
const assetPath = entryPoint.replace(buildOptions.outBase, buildOptions.outDir).replace(winOutBase, buildOptions.outDir).replaceAll("\\", "/");
|
|
226
228
|
if (assetPath.endsWith(".css")) {
|
|
227
229
|
return `<link rel="stylesheet" href="${assetPath}">`;
|
|
228
230
|
} else if (assetPath.endsWith(".js")) {
|
package/dist/vite.js
CHANGED
|
@@ -153,7 +153,9 @@ function vitePluginMinistaVirtualHtml() {
|
|
|
153
153
|
configureServer(server) {
|
|
154
154
|
return () => {
|
|
155
155
|
var _a, _b;
|
|
156
|
-
const
|
|
156
|
+
const ministaHtmlUrl = path.resolve(__dirname + "/../lib/index.html");
|
|
157
|
+
const ministaHtmlUrlRelative = path.relative(".", ministaHtmlUrl);
|
|
158
|
+
const ministaHtml = fs.readFileSync(ministaHtmlUrlRelative, "utf8");
|
|
157
159
|
const assetTagStr = getAssetsTagStr((_b = (_a = server.config.inlineConfig.build) == null ? void 0 : _a.rollupOptions) == null ? void 0 : _b.input);
|
|
158
160
|
const ministaReplacedHtml = ministaHtml.replace("<!-- VIRTUAL_HTML_ASSETS_TAG -->", assetTagStr);
|
|
159
161
|
server.middlewares.use((req, res, next) => {
|