UNPKG

jimdo-templateflow

Version:
30 lines (25 loc) 1.15 kB
'use-strict' var fs = require('fs') var yaml = require('yamljs') var findConfigValue = require('../lib/findConfigValue.js') var isNumberOrBool = require('../lib/isNumberOrBool.js') module.exports = function () { var templateConfig = {} var templateConfigFile = process.env.PWD + '/template.yml' if (fs.existsSync(templateConfigFile)) templateConfig = yaml.load(templateConfigFile) return { baseDir: templateConfig.baseDir || './', bowerDir: templateConfig.bowerDir || 'bower_components', cssDir: templateConfig.cssDir || 'css', cssExt: templateConfig.cssExt || '.css', designId: templateConfig.designId, imgDir: templateConfig.imgDir || '', port: process.env.PORT || templateConfig.port || 8080, publisherEndpoint: process.env.PUBLISHER_ENDPOINT || templateConfig.publisherEndpoint || undefined, sassDir: templateConfig.sassDir || 'sass', hostname: templateConfig.hostname || 'localhost', livereload: findConfigValue([isNumberOrBool(process.env.LIVERELOAD), isNumberOrBool(templateConfig.livereload), true]), sassCompiling: findConfigValue([templateConfig.sassCompiling, true]), } }