mirror of
https://github.com/strapi/strapi.git
synced 2025-11-02 10:55:37 +00:00
Allow app.jsx for typescript projects
This commit is contained in:
parent
bdc043aaec
commit
758c10fb6b
@ -1,6 +1,7 @@
|
||||
'use strict';
|
||||
|
||||
const { join } = require('path');
|
||||
const { eq } = require('lodash/fp');
|
||||
const fse = require('fs-extra');
|
||||
const { isUsingTypeScript } = require('@strapi/typescript-utils');
|
||||
|
||||
@ -15,9 +16,14 @@ const getCustomAppConfigFile = async dir => {
|
||||
|
||||
const files = await fse.readdir(adminSrcPath);
|
||||
|
||||
const appRegex = new RegExp(`app.${useTypeScript ? 't' : 'j'}sx?$`);
|
||||
const appJsx = files.find(eq('app.jsx'));
|
||||
const appTsx = files.find(eq('app.tsx'));
|
||||
|
||||
return files.find(file => file.match(appRegex));
|
||||
if (useTypeScript) {
|
||||
return appTsx || appJsx;
|
||||
}
|
||||
|
||||
return appJsx;
|
||||
};
|
||||
|
||||
module.exports = getCustomAppConfigFile;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user