@midwayjs/view
Version:
Midway Component for render view
24 lines • 1.06 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const path_1 = require("path");
exports.default = appInfo => ({
/**
* view default config
* @member Config#view
* @property {String} [rootDir=${appDir}/view] - give a path to find the file, object.values() got array and find for view file
* @property {Boolean} [cache=true] - whether cache the file's path
* @property {String} [defaultExtension] - defaultExtension can be added automatically when there is no extension when call `ctx.render`
* @property {String} [defaultViewEngine] - set the default view engine if you don't want specify the viewEngine every request.
* @property {Object} mapping - map the file extension to view engine, such as `{ '.ejs': 'ejs' }`
*/
view: {
cache: true,
defaultExtension: '.html',
defaultViewEngine: '',
mapping: {},
rootDir: {
default: (0, path_1.join)(appInfo.appDir, 'view'),
},
},
});
//# sourceMappingURL=config.default.js.map