"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.applyScriptCondition = void 0;
function applyScriptCondition({ rule, config, context, includes, excludes, }) {
    // compile all folders in app directory, exclude node_modules
    rule.include.add({
        and: [context.rootPath, { not: /node_modules/ }],
    });
    [...includes, ...(config.source.include || [])].forEach(condition => {
        rule.include.add(condition);
    });
    [...excludes, ...(config.source.exclude || [])].forEach(condition => {
        rule.exclude.add(condition);
    });
}
exports.applyScriptCondition = applyScriptCondition;
