linaria icon indicating copy to clipboard operation
linaria copied to clipboard

`evaluate: false` not working / is still evaluating code

Open mgreenw opened this issue 11 months ago • 0 comments

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!

mgreenw avatar Mar 08 '24 17:03 mgreenw