) + str
var value = await build_cache_js.get(key)
if (value === undefined) {
- console.log(site, 'js compile', key)
+ console.log(site, 'compiling', key)
value = await jstemplate(key)
build_cache_js.set(key, value)
}
case 'css':
temp = site_path + '.less'
try {
- data = new Buffer(
- (
- await less.render(
- await readFileAsync(site_root + temp, {encoding: 'utf-8'}),
- {
- color: true,
- compress: false,
- depends: false,
- filename: temp,
- globalVars: null,
- ieCompat: false,
- insecure: false,
- javascriptEnabled: false,
- lint: false,
- math: 0,
- modifyVars: null,
- paths: [site_root + dir_name],
- plugins: [],
- reUsePluginManager: true,
- rewriteUrls: false,
- rootpath: '',
- strictImports: false,
- strictUnits: false,
- urlArgs: ''
- }
- )
- ).css,
- 'utf-8'
- )
+ var key = site_root + temp
+ var data = await build_cache_less.get(key)
+ if (data === undefined) {
+ console.log(site, 'compiling', key)
+ var result = await less.render(
+ await readFileAsync(site_root + temp, {encoding: 'utf-8'}),
+ {
+ //color: true,
+ //compress: false,
+ //depends: false,
+ filename: temp,
+ //globalVars: null,
+ //ieCompat: false,
+ //insecure: false,
+ //javascriptEnabled: false,
+ //lint: false,
+ //math: 0,
+ //modifyVars: null,
+ paths: [site_root + dir_name],
+ //plugins: [],
+ //reUsePluginManager: true,
+ //rewriteUrls: false,
+ rootpath: site_root//,
+ //strictImports: false,
+ //strictUnits: false,
+ //urlArgs: ''
+ }
+ )
+ data = new Buffer(result.css, 'utf-8')
+ build_cache_less.set(key, data, result.imports)
+ }
console.log(
site,
'serving',