@suns/react-monorepo-nx
Version:
To evaluate and compare the bundled and unbundled builds on large codebase.
2 lines (1 loc) • 1.81 kB
JavaScript
import{r as d,_ as l,j as e,T as c,S as m}from"./index-f2f184c7.js";const u="_container_th303_5",h={container:u};function a(r,t){for(var s,n=-1,o=r.length;++n<o;){var i=t(r[n]);i!==void 0&&(s=s===void 0?i:s+i)}return s}function x(r){return r}function j(r){return r&&r.length?a(r,x):0}const _=d.lazy(()=>l(()=>import("./lorem_0frontend-odd-524e0dd6.js"),["./lorem_0frontend-odd-524e0dd6.js","./index-f2f184c7.js","./index-ac36217d.css","./lorem_0shared-98e2046d.css"],import.meta.url)),p=d.lazy(()=>l(()=>import("./lorem_1frontend-odd-756483e1.js"),["./lorem_1frontend-odd-756483e1.js","./index-f2f184c7.js","./index-ac36217d.css","./lorem_0shared-98e2046d.css"],import.meta.url)),f=d.lazy(()=>l(()=>import("./lorem_2frontend-odd-9b15f56c.js"),["./lorem_2frontend-odd-9b15f56c.js","./index-f2f184c7.js","./index-ac36217d.css","./lorem_0shared-98e2046d.css"],import.meta.url));function g(r){const[t,s]=d.useState([1,2]);return e.jsxs("div",{className:h.container,children:[e.jsx("h1",{children:"Welcome to FrontendOdd!"}),e.jsxs("section",{children:[e.jsx("code",{children:"import sum from 'lodash'"}),"loads the module from large library. The bundler should be picking ",e.jsx("b",{children:"only"})," code for ",e.jsx("b",{children:"sum"})," so the `odd` module size only few bytes larger of `even`.",e.jsx("table",{children:e.jsxs("tbody",{children:[t.map((n,o)=>e.jsxs("tr",{children:[e.jsx("td",{children:o}),e.jsx("td",{children:n})]},o)),e.jsxs("tr",{children:[e.jsx("th",{children:"∑"}),e.jsxs("td",{children:[j(t)," lodash.sum(numbers)"]})]})]})}),e.jsxs("button",{onClick:()=>{s([...t,10])},children:[" ","ADD 10"]})]}),e.jsx(c,{moduleUrl:import.meta.url,scope:"odd",children:e.jsxs(e.Fragment,{children:[e.jsx(_,{}),e.jsx(p,{}),e.jsx(f,{})]})}),e.jsx(m,{})]})}export{g as FrontendOdd,g as default};