Açıklama Yok

Lee Morgan 6a296bb273 Remove all neovan tmp dirs at start of app, just in case. 4 gün önce
.gitignore c0180d861f Get all routes building from index.html 3 hafta önce
README.md ffd4b786c4 Update the README to reflect updates. 4 gün önce
index.js 6a296bb273 Remove all neovan tmp dirs at start of app, just in case. 4 gün önce
logo.svg e19da3eb05 Create readme file and add the logo. 4 gün önce
package-lock.json 802c6d80e2 Read in all files in each directory. 4 hafta önce
package.json 802c6d80e2 Read in all files in each directory. 4 hafta önce
parseComponent.js 8cb1e037fe Use os tmpdir to write temporary files. 4 gün önce

README.md

NeoVan logo

NeoVan

NeoVan is an "anti-framework" meant to offer some of the convenience of modern frameworks without all of their complexity. The aim is to return to writing plain old HTML, CSS and JavaScript without all the in-between code. In reality, Neovan is mostly just a bundling tool, with a few extra features.

Introduction

Neovan uses filesystem-based routing. You create your routes (and components) in the 'routes' directory. Any directory that has either an index.html or index.neovan file will be considered a route. The index file will pull in any components and bundle all of the HTML, CSS, JS into a single file that will be served for the route.

Getting Started

import express from "express"
import neovan from "neovan"

let options = {
    production: true,
    routesDir: "routes"
};

const app = await neovan(express, options);

app.listen(8000);

Environments

Production

Production environment is set by passing production: true in the options. Alternatively, you can just not pass this property in since it is the default. When in production mode, all routes will be created at build time and maximally minimized for optimization in a production environment.

Depending on the size of your app, this can take some time due to reading through all files. However, once built, there will be no further work needed. When a user visits a route, the full file is already built and ready to serve to them.

Development

Development environment is set by passing production: false in the options. When this is set, the routes will not be bundled at build time, in order to avoid large startup times every single time. Routes will be bundled when they are visited.

Options

Property Type Default Description
production boolean true Sets environment
routesDir string routes Directory for containing code for routes/components
buildDir string .build Directory where build files will be stored
assetsDir string assets Directory for serving assets like images
assetsRoute string /assets Route to serve assets from