Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 

README.md

Documents Example

This Vite React example shows the intended Infrastructure on Rails workflow:

import { documents } from "rails";

The import is the configuration. The Vite plugin in vite.config.ts discovers that import during dev and build, then writes .rails/infrastructure.ts.

Run It

From this directory:

npm install
npm run dev

Or build it:

npm run build

The app calls documents.fileNames() in src/App.tsx. After Vite touches that file, Rails generates .rails/infrastructure.ts.