@jsenv/cli
Version:
Command Line Interface for jsenv
1 lines • 1.87 kB
JavaScript
import{u as e,j as t,F as n,a as o,b as a,_ as r,c}from"/jsenv_template_web_react_node_modules.js";("object"==typeof self?self:process).__InlineContent__=function(e,{type:t="text/plain"}){this.text=e,this.type=t};const i=new __InlineContent__(".app{text-align:center}.app_logo{pointer-events:none;height:40vmin}@media (prefers-reduced-motion:no-preference){.app_logo{animation:20s linear infinite app_logo_spin}}.app_header{color:#fff;background-color:#282c34;flex-direction:column;justify-content:center;align-items:center;min-height:100vh;font-size:calc(10px + 2vmin);display:flex}.app_link{color:#61dafb}@keyframes app_logo_spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}button{font-size:calc(10px + 2vmin)}",{type:"text/css"}),l=new CSSStyleSheet;l.replaceSync(i.text);const p=()=>{const[a,r]=e(0);return t(n,{children:[o("button",{id:"counter_button",type:"button",onClick:()=>r((e=>e+1)),children:"Click me"}),o("br",{}),"number of click: ",o("span",{id:"counter_output",children:a})]})},s=import.meta.resolve(__v__("/other/react_logo.svg")),d=()=>(a((()=>(document.adoptedStyleSheets=[...document.adoptedStyleSheets,l],()=>{document.adoptedStyleSheets=document.adoptedStyleSheets.filter((e=>e!==l))})),[]),o("div",{className:"app",children:t("header",{className:"app_header",children:[o("img",{src:s,className:"app_logo",alt:"logo"}),o("p",{children:"Hello jsenv + React!"}),o("p",{children:o(p,{})}),t("p",{children:["Edit"," ",o("a",{className:"app_link",onClick:e=>{e.preventDefault(),window.fetch("/.internal/open_file/app/app.jsx")},children:"app.jsx"})," ","and save to test HMR updates."]}),o("p",{children:o("a",{className:"app_link",href:"https://github.com/jsenv/core",target:"_blank",rel:"noopener noreferrer",children:"Jsenv documentation"})})]})}));r.createRoot(document.querySelector("#root")).render(o(c.StrictMode,{children:o(d,{})}));