revojs 0.1.0 → 0.1.1
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/vite/index.js +9 -1
- package/package.json +1 -1
package/dist/vite/index.js
CHANGED
|
@@ -8,7 +8,7 @@ import { existsSync, readFileSync } from "fs";
|
|
|
8
8
|
|
|
9
9
|
//#region package.json
|
|
10
10
|
var name = "revojs";
|
|
11
|
-
var version = "0.1.
|
|
11
|
+
var version = "0.1.1";
|
|
12
12
|
|
|
13
13
|
//#endregion
|
|
14
14
|
//#region src/server/index.ts
|
|
@@ -250,15 +250,23 @@ async function toNodeRequest(res, nodeRes) {
|
|
|
250
250
|
const SUFFIX = "?client";
|
|
251
251
|
function client() {
|
|
252
252
|
let server;
|
|
253
|
+
let bundle;
|
|
253
254
|
return {
|
|
254
255
|
name: "client",
|
|
255
256
|
sharedDuringBuild: true,
|
|
256
257
|
configureServer(devServer) {
|
|
257
258
|
server = devServer;
|
|
258
259
|
},
|
|
260
|
+
writeBundle(_, clientBundle) {
|
|
261
|
+
if (this.environment.name === CLIENT) bundle = clientBundle;
|
|
262
|
+
},
|
|
259
263
|
load(key) {
|
|
260
264
|
if (key.endsWith(SUFFIX)) {
|
|
261
265
|
const path = key.substring(0, key.length - 7);
|
|
266
|
+
if (bundle) for (const name$1 in bundle) {
|
|
267
|
+
const file = bundle[name$1];
|
|
268
|
+
if (file && file.type === "asset" && file.originalFileNames.includes(basename(path))) return file.source.toString();
|
|
269
|
+
}
|
|
262
270
|
return readFileSync(path, "utf-8");
|
|
263
271
|
}
|
|
264
272
|
return null;
|