@dokebi/template-inertia 0.4.13 → 0.4.14
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.js +11 -3
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -519,7 +519,12 @@ class InertiaRuntime {
|
|
|
519
519
|
}
|
|
520
520
|
// Development (D-0045): one Vite for every scope, reached by the first `vite` (the host of
|
|
521
521
|
// `dokebi dev`, shared by every worker, or one started in this process).
|
|
522
|
-
|
|
522
|
+
// D-0251: a process that opens no web port (`dokebi-web.listen: false`, a worker next to the
|
|
523
|
+
// web process) serves no page: it reads no Vite manifest or SSR bundle and opens no Vite, so a
|
|
524
|
+
// worker starts without a build and `dokebi dev` gives it no Vite.
|
|
525
|
+
const serving = context.app.config['dokebi-web']?.listen !==
|
|
526
|
+
false;
|
|
527
|
+
const develop = serving && viteDevRequested();
|
|
523
528
|
// When the dev host restarts, Vite's client pings it from a `blob:` SharedWorker, which
|
|
524
529
|
// script-src would block without worker-src (community request A4). The HMR socket itself
|
|
525
530
|
// goes to the page's own origin, which connect-src 'self' allows; a Vite config that sends it
|
|
@@ -532,6 +537,7 @@ class InertiaRuntime {
|
|
|
532
537
|
});
|
|
533
538
|
logger.log('debug', 'Inertia settings resolved', {
|
|
534
539
|
develop,
|
|
540
|
+
serving,
|
|
535
541
|
vite: this.settings.vite ? { ...this.settings.vite } : false,
|
|
536
542
|
ssr: this.settings.ssr ? { ...this.settings.ssr } : false,
|
|
537
543
|
devHosts: this.settings.devHosts.length,
|
|
@@ -756,6 +762,8 @@ class InertiaRuntime {
|
|
|
756
762
|
const built = async (options) => {
|
|
757
763
|
if (describing)
|
|
758
764
|
return { scripts: [], styles: [], version: 'describe' };
|
|
765
|
+
if (!serving)
|
|
766
|
+
return { scripts: [], styles: [], version: 'not-serving' };
|
|
759
767
|
if (develop) {
|
|
760
768
|
await viteDev(options.base);
|
|
761
769
|
return {
|
|
@@ -855,7 +863,7 @@ class InertiaRuntime {
|
|
|
855
863
|
const bundles = new Map();
|
|
856
864
|
const stats = { renders: 0, failures: 0 };
|
|
857
865
|
const serverRendering = async (ssr, vite) => {
|
|
858
|
-
if (!ssr || describing)
|
|
866
|
+
if (!ssr || describing || !serving)
|
|
859
867
|
return undefined;
|
|
860
868
|
let render;
|
|
861
869
|
if (develop) {
|
|
@@ -1053,7 +1061,7 @@ class InertiaRuntime {
|
|
|
1053
1061
|
}
|
|
1054
1062
|
export const createPlugin = definePlugin({
|
|
1055
1063
|
name: 'dokebi-template-inertia',
|
|
1056
|
-
version: '0.4.
|
|
1064
|
+
version: '0.4.14',
|
|
1057
1065
|
core: '^0.4.2',
|
|
1058
1066
|
options,
|
|
1059
1067
|
entry: parseEntry,
|
package/package.json
CHANGED