JXC
A javascript "framwork" to compile tsx and jsx files to static index.html files on the server. It uses Babel and a custom compiler.
Template setup proccess:
npx degit PowerKuu/templates/jxc <name>
Manual setup proccess:
- Create a new empty folder
mkdir x
cd x
npm install @klevn/jxc
{
"compilerOptions": {
"jsx": "preserve",
"types": ["@klevn/jxc/src/types/jsx"]
}
}
mkdir routes
cd routes
mkdir home
cd home
export default () => {
return <html lang="en">
<head>
<title>Document</title>
<script>
{
() => {
console.log("this is client side")
}
}
</script>
</head>
<body>
<p>Hello world</p>
</body>
</html>
}
- Build to static assets in the project root
cd ../..
npx @klevn/jxc build
- Use modules css or regular classes
import styles from "./test.module.css.ts.js"
function Component() {
return <p class={[styles.text]}></p>
}