Skip to content

Inline CSS file as string - CJS bundle simply converts this to void 0 #744

Description

@rschristian

Bit of a weird use case, but I need to inline a CSS file as a string within a bundle.

I can do this just fine with UMD, ES Module, and Modern outputs, but where they contain a string representation of the CSS file, the CJS output just has void 0 in its place. Bug, or is this a limitation of the CJS output in some way?

import stylesheet from "./css/styles.css";
console.log(stylesheet);

While console.log() is certainly not the "real" use case, it acts the same as the real use case and is simpler to display with.

This is also with the --css-modules flag having been set to false.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions