javascript - Load Less file in Node Module with Express -
i'm building express app , i've downloaded material-colors module. wondering how can use less file includes app. i'm using less , express-less render master.css , it's working fine code:
server.js
const express = require('express'); const app = express(); const expressless = require('express-less'); const port = process.env.port || 8080; app.set('view engine', 'pug') app.use(express.static(__dirname + '/public')); app.use('/css', expressless(__dirname + '/less')); app.get('/', (req, res) => { res.render('layout'); }) app.listen(port, () => { console.log('app running'); }) html (pug)
doctype html html head meta(charset="utf-8") title somethin link(rel="stylesheet", href="/css/master.css") link(rel="stylesheet", href="https://overpass-30e2.kxcdn.com/overpass.css") body a(href='https://google.com') link this renders fine. wanted add less file material-colors module, added these 2 lines link(rel="stylesheet", href="/css/colors.css") , app.use('/css', expressless(__dirname + '/node_modules/material-colors/dist')); console says http://localhost:5000/css/colors.css
how load less file express app?
Comments
Post a Comment