Add the possibility to ignore diagnostics from strapi.compile

This commit is contained in:
Convly 2023-09-06 17:24:59 +02:00
parent 0eff5fb121
commit 795b9c4df4

View File

@ -2,15 +2,19 @@
const tsUtils = require('@strapi/typescript-utils');
module.exports = async (dir) => {
const appDir = dir || process.cwd();
/**
* @param {object} [options]
* @param {string} [options.appDir]
* @param {boolean} [options.ignoreDiagnostics]
*/
module.exports = async (options = {}) => {
const { appDir = process.cwd(), ignoreDiagnostics = false } = options;
const isTSProject = await tsUtils.isUsingTypeScript(appDir);
const outDir = await tsUtils.resolveOutDir(appDir);
if (isTSProject) {
await tsUtils.compile(appDir, {
watch: false,
configOptions: { options: { incremental: true } },
configOptions: { options: { incremental: true }, ignoreDiagnostics },
});
}