revojs 0.1.0 → 0.1.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/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/vite/index.d.ts +1 -0
- package/dist/vite/index.js +11 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
package/dist/vite/index.d.ts
CHANGED
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.2";
|
|
12
12
|
|
|
13
13
|
//#endregion
|
|
14
14
|
//#region src/server/index.ts
|
|
@@ -71,6 +71,7 @@ function mergeObjects(base, input) {
|
|
|
71
71
|
function createApp(inputConfig) {
|
|
72
72
|
let config = mergeObjects(inputConfig, {
|
|
73
73
|
modules: [],
|
|
74
|
+
externals: [],
|
|
74
75
|
sources: {
|
|
75
76
|
assets: {
|
|
76
77
|
match: "**/*",
|
|
@@ -250,15 +251,23 @@ async function toNodeRequest(res, nodeRes) {
|
|
|
250
251
|
const SUFFIX = "?client";
|
|
251
252
|
function client() {
|
|
252
253
|
let server;
|
|
254
|
+
let bundle;
|
|
253
255
|
return {
|
|
254
256
|
name: "client",
|
|
255
257
|
sharedDuringBuild: true,
|
|
256
258
|
configureServer(devServer) {
|
|
257
259
|
server = devServer;
|
|
258
260
|
},
|
|
261
|
+
writeBundle(_, clientBundle) {
|
|
262
|
+
if (this.environment.name === CLIENT) bundle = clientBundle;
|
|
263
|
+
},
|
|
259
264
|
load(key) {
|
|
260
265
|
if (key.endsWith(SUFFIX)) {
|
|
261
266
|
const path = key.substring(0, key.length - 7);
|
|
267
|
+
if (bundle) for (const name$1 in bundle) {
|
|
268
|
+
const file = bundle[name$1];
|
|
269
|
+
if (file && file.type === "asset" && file.originalFileNames.includes(basename(path))) return file.source.toString();
|
|
270
|
+
}
|
|
262
271
|
return readFileSync(path, "utf-8");
|
|
263
272
|
}
|
|
264
273
|
return null;
|
|
@@ -390,6 +399,7 @@ function revojs(config) {
|
|
|
390
399
|
return {
|
|
391
400
|
appType: "custom",
|
|
392
401
|
resolve: { alias: app.alias },
|
|
402
|
+
build: { rollupOptions: { external: app.config.externals } },
|
|
393
403
|
environments: {
|
|
394
404
|
...app.config.client && { [CLIENT]: {
|
|
395
405
|
consumer: "client",
|