Skip to content

evaluate: false not working / is still evaluating code #1396

Open
@mgreenw

Description

@mgreenw

Environment

  • Linaria version: 5.x (haven't tried v6)
  • Bundler (+ version): Webpack v5
  • Node.js version: 20.x
  • OS: macOS

Description

When I set evaluate: false, I expect Linaria to not evaluate my source code in a vm via the babel transform, and instead to rely on the AST only to do the required transformations and CSS file generation. However, it seems like setting evaluate: false does not stop linaria from evaluating the source files, which can lead to issues if dependencies are not ready to be statically evaluated like that.

This is a really important feature for folks that don't want to or need to have dynamic JS expressions in their css template literals, and will speed up builds.

Thank you!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions