@lomray/vite-ssr-boost 8.0.0-beta.2 → 8.0.0-beta.3
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/package.json
CHANGED
package/plugin.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import e from"node:path";import i from"node:process";import o from"./constants/cli-actions.js";import
|
|
1
|
+
import e from"node:path";import i from"node:process";import o from"./constants/cli-actions.js";import s from"./constants/plugin-name.js";import t from"./plugins/create-spa-index.js";import{getCurrentEntrypoint as n,ViteHandleCustomEntrypointPlugin as p}from"./plugins/handle-custom-entrypoint.js";import r from"./plugins/make-aliases.js";import m from"./plugins/normalize-route.js";import a from"./plugins/optimize-browser-dependencies.js";const l={indexFile:"index.html",serverFile:"server.ts",clientFile:"client.ts",tsconfigAliases:!0,spaIndex:!1};function u(u={}){const d=new URL(import.meta.url),c=global.viteBoostAction||i.env.SSR_BOOST_ACTION,f={...l,...u},S=n(f.entrypoint??[]),g="1"===i.env.SSR_BOOST_IS_SSR||c===o.dev,h=c===o.build,v=[{name:s,enforce:"pre",pluginOptions:{...f,pluginPath:e.dirname(d.pathname),action:c,isDev:c===o.dev},config:(e,{command:i,isSsrBuild:o})=>(e.define={...e.define??{},__IS_SSR__:S?"ssr"===S.type:g},e.build={...e.build??{}},o?{...e,...h?{appType:"custom"}:{},publicDir:!1}:("serve"===i&&(e.optimizeDeps=a(e.optimizeDeps)),g&&h&&(e.build.manifest=!0),e))}],{tsconfigAliases:_,routesPath:b,spaIndex:j}=f;return _&&v.push(r("boolean"==typeof _?void 0:_)),j&&v.push(t("boolean"==typeof j?void 0:j)),S&&v.push(p({entrypoint:S})),v.push(m({isSSR:g,isBuild:h,routesPath:b})),v}export{u as default};
|
|
2
2
|
//# sourceMappingURL=plugin.js.map
|
package/plugin.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.js","sources":["../src/plugin.ts"],"sourcesContent":[null],"names":["defaultOptions","indexFile","serverFile","clientFile","tsconfigAliases","spaIndex","ViteSsrBoostPlugin","options","dirInfo","URL","url","action","global","viteBoostAction","process","env","SSR_BOOST_ACTION","mergedOptions","entrypointConfig","getCurrentEntrypoint","entrypoint","isSSR","SSR_BOOST_IS_SSR","CliActions","dev","isBuild","build","plugins","name","PLUGIN_NAME","enforce","pluginOptions","pluginPath","path","dirname","pathname","isDev","config","isSsrBuild","define","__IS_SSR__","type","appType","publicDir","manifest","routesPath","push","ViteMakeAliasesPlugin","undefined","ViteCreateSPAIndexPlugin","ViteHandleCustomEntrypointPlugin","ViteNormalizeRouterPlugin"],"mappings":"
|
|
1
|
+
{"version":3,"file":"plugin.js","sources":["../src/plugin.ts"],"sourcesContent":[null],"names":["defaultOptions","indexFile","serverFile","clientFile","tsconfigAliases","spaIndex","ViteSsrBoostPlugin","options","dirInfo","URL","url","action","global","viteBoostAction","process","env","SSR_BOOST_ACTION","mergedOptions","entrypointConfig","getCurrentEntrypoint","entrypoint","isSSR","SSR_BOOST_IS_SSR","CliActions","dev","isBuild","build","plugins","name","PLUGIN_NAME","enforce","pluginOptions","pluginPath","path","dirname","pathname","isDev","config","command","isSsrBuild","define","__IS_SSR__","type","appType","publicDir","optimizeDeps","optimizeBrowserDependencies","manifest","routesPath","push","ViteMakeAliasesPlugin","undefined","ViteCreateSPAIndexPlugin","ViteHandleCustomEntrypointPlugin","ViteNormalizeRouterPlugin"],"mappings":"wbA0CA,MAAMA,EAAiC,CACrCC,UAAW,aACXC,WAAY,YACZC,WAAY,YACZC,iBAAiB,EACjBC,UAAU,GAOZ,SAASC,EAAmBC,EAA0B,IACpD,MAAMC,EAAU,IAAIC,gBAAgBC,KAC9BC,EAAUC,OAAOC,iBAAmBC,EAAQC,IAAIC,iBAChDC,EAAgC,IAAKjB,KAAmBO,GACxDW,EAAmBC,EAAqBF,EAAcG,YAAc,IACpEC,EAAyC,MAAjCP,EAAQC,IAAIO,kBAA4BX,IAAWY,EAAWC,IACtEC,EAAUd,IAAWY,EAAWG,MAEhCC,EAAoB,CACxB,CACEC,KAAMC,EACNC,QAAS,MAETC,cAAe,IACVd,EACHe,WAAYC,EAAKC,QAAQ1B,EAAQ2B,UACjCxB,SACAyB,MAAOzB,IAAWY,EAAWC,KAG/Ba,OAAM,CAACA,GAAQC,QAAEA,EAAOC,WAAEA,MACxBF,EAAOG,OAAS,IACVH,EAAOG,QAAU,GACrBC,WAAYvB,EAA6C,QAA1BA,EAAiBwB,KAAiBrB,GAGnEgB,EAAOX,MAAQ,IACTW,EAAOX,OAAS,IAGjBa,EAYE,IACFF,KACCZ,EAAU,CAAEkB,QAAS,UAAa,CAAA,EACtCC,WAAW,IAdK,UAAZN,IACFD,EAAOQ,aAAeC,EAA4BT,EAAOQ,eAGvDxB,GAASI,IACXY,EAAOX,MAAMqB,UAAW,GAGnBV,OAYTjC,gBAAEA,EAAe4C,WAAEA,EAAU3C,SAAEA,GAAaY,EAkBlD,OAhBIb,GACFuB,EAAQsB,KACNC,EAAiD,kBAApB9C,OAAgC+C,EAAY/C,IAIzEC,GACFsB,EAAQsB,KAAKG,EAA6C,kBAAb/C,OAAyB8C,EAAY9C,IAGhFa,GACFS,EAAQsB,KAAKI,EAAiC,CAAEjC,WAAYF,KAG9DS,EAAQsB,KAAKK,EAA0B,CAAEjC,QAAOI,UAASuB,gBAElDrB,CACT"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { DepOptimizationOptions } from 'vite';
|
|
2
|
+
/**
|
|
3
|
+
* Include imports injected by route normalization before the first browser request.
|
|
4
|
+
*/
|
|
5
|
+
declare const optimizeBrowserDependencies: (options?: DepOptimizationOptions) => DepOptimizationOptions;
|
|
6
|
+
export default optimizeBrowserDependencies;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import e from"../constants/plugin-name.js";const t=["react","react-dom","react-dom/client","react-router","hoist-non-react-statics",...["browser/entry","components/navigate","components/only-client","components/render-client","components/response-status","components/scroll-to-top","components/with-suspense","constants/common","context/server","helpers/get-server-state","helpers/import-route","interfaces/fc-route"].flatMap(t=>[`${e}/${t}`,`${e}/${t}.js`])],s=t=>t.startsWith(`${e}/`)?t.replace(/\.js$/,""):t,n=(e={})=>({...e,include:[...new Set([...e.include??[],...t])].filter(t=>!(e.exclude??[]).some(e=>{const n=s(t),o=s(e).replace(/\/$/,"");return n===o||n.startsWith(`${o}/`)}))});export{n as default};
|
|
2
|
+
//# sourceMappingURL=optimize-browser-dependencies.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"optimize-browser-dependencies.js","sources":["../../src/plugins/optimize-browser-dependencies.ts"],"sourcesContent":[null],"names":["browserDependencies","flatMap","id","PLUGIN_NAME","normalizeImport","startsWith","replace","optimizeBrowserDependencies","options","include","Set","filter","exclude","some","excluded","dependency","exclusion"],"mappings":"2CAKA,MAeMA,EAAsB,CAC1B,QACA,YACA,mBACA,eACA,6BApBqB,CACrB,gBACA,sBACA,yBACA,2BACA,6BACA,2BACA,2BACA,mBACA,iBACA,2BACA,uBACA,uBACAC,QAASC,GAAO,CAAC,GAAGC,KAAeD,IAAM,GAAGC,KAAeD,UAWvDE,EAAmBF,GACvBA,EAAGG,WAAW,GAAGF,MAAkBD,EAAGI,QAAQ,QAAS,IAAMJ,EAKzDK,EAA8B,CAClCC,EAAkC,MAAE,IAEjCA,EACHC,QAAS,IAAI,IAAIC,IAAI,IAAKF,EAAQC,SAAW,MAAQT,KAAuBW,OACzET,KACGM,EAAQI,SAAW,IAAIC,KAAMC,IAC7B,MAAMC,EAAaX,EAAgBF,GAC7Bc,EAAYZ,EAAgBU,GAAUR,QAAQ,MAAO,IAG3D,OAAOS,IAAeC,GAAaD,EAAWV,WAAW,GAAGW"}
|