Skip to content

Incorrect metadata file content generated for postcss extraEntries in FE Build #129

Description

@Hugoer

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions