Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Unplugin usage doesn't tap into the standard CSS build pipeline #1378

@pawelblaszczyk5

Description

@pawelblaszczyk5

Describe the issue

Hello,
After upgrading to the unplugin setup (using Vite) I've looked into assets produced by my app and spotted one thing - the styles part produced by StyleX weren't minified. So I wondered why does it happen and looked into the implementation. It seems like the output is manually appended to already built file, by either appending to its source or writing directly with fs module.

If I understand correctly, that's a bit of antipattern and is discouraged by e.g. Rollup:

Image

Is it somehow possible to make it a part of standard bundle, so it's handled by minification and other parts of CSS building - e.g. down-leveling? Or was it some limitation/purposeful choice?

Or is the intended usage to handle everything via lightningcssOptions? That would require to mimic the pipeline from Vite over there 🤔

Expected behavior

CSS emitted by StyleX is part of normal CSS bundling in bundlers, it's minified and processed

Steps to reproduce

  1. Use the unplugin setup
  2. Build the app

Test case

No response

Additional comments

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions