1.2 KiB
1.2 KiB
Building the Frontend
LayerForge uses TypeScript for its frontend source and compiles it to JavaScript for use in the browser.
Requirements
- Node.js, which includes npm
- Python checks are documented in TESTING.md.
Install dependencies
Before the first build, open a terminal in the project root and install the development dependencies:
npm install
Build the project
Run the following command from the project root to compile TypeScript and copy the CSS and HTML assets:
.\\build.bat
The build script:
- Copies files from
src/csstojs/css. - Copies files from
src/templatestojs/templates. - Compiles TypeScript files from
srcinto JavaScript files injs.
The generated files in js/ are served by ComfyUI. Keep src/ as the source of truth and rebuild after changing TypeScript, CSS, or template files.
Watch mode
To rebuild automatically whenever TypeScript, CSS, or HTML files in src change, run:
.\\node_modules\\.bin\\nodemon.cmd --watch src --ext ts,css,html --exec .\\build.bat
This uses nodemon to watch the src directory and run build.bat after a source change.