You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If a entry point with the names "editor.js" and "editor.css" exists, only one of them will be built. To solve this we would need to call one of them something else, and this is not a big deal, the only issue is that it's confusing and hard to debug if you're not familiar with the issue.
Possible solutions:
Add a suffix to the duplicate entry if it's a style or script.
const prepareConfig = (dir, files) => {
const entries = {};
files.forEach((file) => {
const filePath = path.resolve(__dirname, dir, file);
const fileExt = path.parse(file).ext;
let fileName = path.parse(file).name;
// If a duplicate entry is found, add a suffix to the entry name.
if (Array.isArray(entries[fileName])) {
if (fileExt === '.js') {
fileName = fileName + '-scripts';
}
if (fileExt === '.css' || fileExt === '.scss') {
fileName = fileName + '-styles';
}
entries[fileName] = [];
}
if (typeof entries[fileName] === 'undefined') {
entries[fileName] = [];
}
entries[fileName].push(filePath);
});
or throw an error so that atleast we get some feedback to why it's not building the other file
If a entry point with the names "editor.js" and "editor.css" exists, only one of them will be built. To solve this we would need to call one of them something else, and this is not a big deal, the only issue is that it's confusing and hard to debug if you're not familiar with the issue.
Possible solutions:
Add a suffix to the duplicate entry if it's a style or script.
or throw an error so that atleast we get some feedback to why it's not building the other file
The text was updated successfully, but these errors were encountered: