mirror of
https://github.com/strapi/strapi.git
synced 2025-12-27 07:03:38 +00:00
Add the possibility to ignore diagnostics from strapi.compile
This commit is contained in:
parent
0eff5fb121
commit
795b9c4df4
@ -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 },
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user