In the NC FE Build, when generating metadata files (such as css.txt) for clientlibs, the content is sometimes incorrect for files created during the PostCSS plugin process.
This happens because the build script always reads the js variable instead of the actual content relevant to the specific extension file.
Old code (buggy):
const extensionFile = config.postcss.extraEntries?.extension;
const hasExtraEntries = extensionFile && clientLibObject[extensionFile];
if (hasExtraEntries) {
writeFile(path.join(absolutePath, `${extensionFile}.txt`), `${js}`, override);
}
Fixed code:
const extensionFile = config.postcss.extraEntries?.extension;
const hasExtraEntries = extensionFile && clientLibObject[extensionFile];
const fileName = clientLibObject[extensionFile];
if (hasExtraEntries) {
writeFile(path.join(absolutePath, `${extensionFile}.txt`), `${fileName}`, override);
}
This change ensures that the correct file content is written for each extension type, resolving metadata inconsistencies during the build process.
In the NC FE Build, when generating metadata files (such as css.txt) for clientlibs, the content is sometimes incorrect for files created during the PostCSS plugin process.
This happens because the build script always reads the js variable instead of the actual content relevant to the specific extension file.
Old code (buggy):
Fixed code:
This change ensures that the correct file content is written for each extension type, resolving metadata inconsistencies during the build process.