-
Notifications
You must be signed in to change notification settings - Fork 41
LESS Support
Gilbert edited this page Sep 8, 2016
·
1 revision
First create the file client/app.less
. This is the main file that will @import
all other .less
files you need in your app. I recommend adding the following CSS so you can visually see when it all works:
body { background: orange; }
Next, install node-less-endpoint:
$ npm install node-less-endpoint --save
and add the following to your server/index.js
, before the catch-all route:
var LESS = require('node-less-endpoint');
app.get('/css/app-bundle.css',
LESS.serve('./client/app.less'));
Lastly, add a <link>
tag to your client/public/index.html
page:
<head>
<title>My App</title>
<link rel="stylesheet" href="/css/app-bundle.css"/>
</head>