Getting Started
Before continuing, please make sure you have the latest LTS release of Node.JS, understanding of the basics of file system, and basic programming knowledge in JavaScript
Installation
The easiest way to get started with elegance is using npx create-elegance-app my-website which will create a template project.
However, if you prefer manual installation, here is how to do it.
- Create a directory to store your project in.
- Navigate to that directory, and initialize npm with
npm init -y - Install Elegance with
npm install elegance-js - Create a
env.d.tsat the root of your project. - Put
/// <reference types="elegance-js/global" />inside that file. - Create a
pagesdirectory, which will contain the pages and layouts of your project. - Create a
publicdirectory which will contain publicly accessible files you want to share. - Create the elegance runtime file, following the instructions from the manual section in the compiler guide
- Create an
index.tsfile which you will run withnpx ts-arc index.ts - In that file, at some point, call
startEleganceRuntime()fromelegance-js. - Run your
index.tsfile withnpx ts-arc index.ts. Other typescript runtimes may work, butts-arcis the intended way.
Manual Quick Install
If you want to use the preset files, but want access to customize the index.ts and elegance.ts files, you can use --manual mode in npx create-elegance-app