UNPKG

537 BJavaScriptView Raw
1const path = require('path');
2const fs = require('fs');
3const transform = require('../util/transform');
4const ncp = require('ncp').ncp;
5
6
7const Page = function(){
8
9}
10
11Page.config = (templatePath)=>{
12 if(!templatePath){
13 templatePath = './templates/page';
14 }
15 var text = fs.readFileSync(path.resolve(__dirname, `../config.js`) ,'utf-8')
16 .replace(/"templatePath":".*"/, `"templatePath":"${templatePath}"`)
17 fs.writeFileSync(path.resolve(__dirname, '../config.js'), text, { encoding:'utf-8', flag:'w' });
18}
19
20module.exports = Page;