Plugin for serving less
npm install --save fastify-less
Place your less files in a folder. Add the plugin to serve them up.
.
├── less
│ └── style.less
├── public
│ └── index.html
└── server.js
const fastify = require('fastify')()
const path = require('path')
fastify.register(require('fastify-static'), {
prefix: '/css',
root: Path.join(__dirname, 'public/less'),
cache: false
})
<link rel="stylesheet" type="text/css" href="/css/style.css"></link>
Absolute path to the directory containt less files. The filename requested will be appended to this path. Requests for a file ending in .css
will seek a matching .less
file.
Default: '/css'
The mountpoint the files are served from.
Default: false
In-memory cache the rendered less. Omit in development so files can be reloaded when changed.
Licensed under MIT