"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.isHtmlDisabled = exports.getTemplatePath = void 0;
const path_1 = __importDefault(require("path"));
function getTemplatePath(entryName, config) {
    const DEFAULT_TEMPLATE = path_1.default.resolve(__dirname, '../../static/template.html');
    const { template = DEFAULT_TEMPLATE, templateByEntries = {} } = config.html;
    return templateByEntries[entryName] || template;
}
exports.getTemplatePath = getTemplatePath;
const isHtmlDisabled = (config, target) => {
    const { htmlPlugin } = config.tools;
    return (htmlPlugin === false ||
        target === 'node' ||
        target === 'web-worker' ||
        target === 'service-worker');
};
exports.isHtmlDisabled = isHtmlDisabled;
