run-task.js 616 Bytes
'use strict';

const path = require('path');
const config = require('./config/config');
const yohoLib = require('yoho-node-lib');

// set root path
global.ROOT_PATH = path.join(__dirname, '');

// 全局注册library
yohoLib.global(config);

// set root path
global.ROOT_PATH = path.join(__dirname, '');

try {

  const seoTask = require('./seo-task');
  const SitemapTask = require('./sitemap-task');

  const h5Task = new SitemapTask('sitemap h5 task', 'h5');
  const pcTask = new SitemapTask('sitemap pc task', 'pc');

  seoTask.intHandle();
  h5Task.init();
  pcTask.init();

} catch (e) {
  console.error(e);
}