npm i @coodev/react react react-dom
Create page component in pages
directory, for example pages/index.tsx
import React from 'react'
export default function Home() {
return <div>Home</div>
}
Add dev script in package.json
{
"scripts": {
"dev": "coodev-react"
}
}
Start development server
npm run dev
Add build script in package.json
{
"scripts": {
"build": "coodev-react build"
}
}
Build
npm run build
/**
* config
*/
const coodevConfig = {
root: '.',
ssr: {
streamingHtml: true,
},
runtimeConfig: {},
plugins: [
{
configResolved?(config: InternalConfiguration): Promisable<void>
configureCoodev?(coodev: Coodev): void | (() => void)
buildEnd?(options: BuildEndOptions, output: BuildOutput): Promisable<void>
documentHtml?(html: string): Promisable<void | string>
htmlRendered?(html: string): Promisable<void | string>
}
],
}