Decide whether to live-compile stylus based on the presence of style.styl
This commit is contained in:
parent
2bc30b3a5b
commit
cfc28ee30e
|
@ -2,3 +2,4 @@ node_modules
|
||||||
.env
|
.env
|
||||||
src
|
src
|
||||||
start.sh
|
start.sh
|
||||||
|
static/style.styl
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
import fs from 'fs'
|
||||||
import path from 'path'
|
import path from 'path'
|
||||||
import { pwrap, pick, fcurrency, fmsat, pngPixel } from './lib/util'
|
import { pwrap, pick, fcurrency, fmsat, pngPixel } from './lib/util'
|
||||||
|
|
||||||
|
@ -39,7 +40,7 @@ app.use(require('body-parser').urlencoded({ extended: false }))
|
||||||
app.use(require('csurf')({ cookie: true }))
|
app.use(require('csurf')({ cookie: true }))
|
||||||
|
|
||||||
// Static assets
|
// Static assets
|
||||||
if (app.settings.env == 'development' && require.resolve('stylus'))
|
if (fs.existsSync(path.join(conf.static_dir, 'style.styl')))
|
||||||
app.use('/_assets', require('stylus').middleware({ src: conf.static_dir, serve: true }))
|
app.use('/_assets', require('stylus').middleware({ src: conf.static_dir, serve: true }))
|
||||||
|
|
||||||
app.use('/_assets', require('express').static(conf.static_dir))
|
app.use('/_assets', require('express').static(conf.static_dir))
|
||||||
|
|
Loading…
Reference in New Issue