Fix PR feedback

Signed-off-by: soupette <cyril@strapi.io>
This commit is contained in:
soupette 2022-04-08 15:31:29 +02:00
parent 5491aa7a81
commit 3d193b3137

View File

@ -11,6 +11,8 @@ const NodePolyfillPlugin = require('node-polyfill-webpack-plugin');
const alias = require('./webpack.alias');
const getClientEnvironment = require('./env');
const EE_REGEX = /from.* ['"]ee_else_ce\//;
module.exports = ({
entry,
cacheDir,
@ -92,11 +94,7 @@ module.exports = ({
try {
const fileContent = fse.readFileSync(filePath).toString();
if (fileContent.match(/from.* ['"]ee_else_ce\//)) {
return true;
}
return false;
return EE_REGEX.test(fileContent);
} catch (e) {
return false;
}