module.exports.getEntryFile = function () {
    let pages = [];

    let utils = light.util, path = require('path');
    let files = utils.glob.sync(`${light.config.src}/*.html`, {
        nodir: true,
        matchBase: true
    })

    files.forEach(function (file) {
        let suffix = path.extname(file);
        //获取文件的名去扩展名
        let fileId = path.basename(file, suffix);
        pages.push(fileId)
    })

    let fs = require('fs');
    if (light.options.page && fs.existsSync(`${light.config.src}/${light.options.page}.html`)) {
        pages = [light.options.page]
    }

    let mainPage = pages.length == 1 && pages[0] == 'index' && light.options.page != 'index' ? 'app' : 'index';

    return {
        pages: pages,
        mainPage: mainPage
    }
}

