@klevn/jxc
TypeScript icon, indicating that this package has built-in type declarations

38.8.9 • Public • Published

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
  • Install JXC
npm install @klevn/jxc
  • Create a tsconfig file
{
    "compilerOptions": {
        "jsx": "preserve",
        "types": ["@klevn/jxc/src/types/jsx"]
    }
}
  • Create a routes folder
mkdir routes
cd routes
  • Create a home routes
mkdir home
cd home
  • Create a index.tsx file
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>
}

Package Sidebar

Install

npm i @klevn/jxc

Weekly Downloads

0

Version

38.8.9

License

ISC

Unpacked Size

82.4 kB

Total Files

55

Last publish

Collaborators

  • klevn