Skip to content

css-in-js emotion autoLabel选项无效,开发环境无法展示出类名快速定位 #570

@cskunkun

Description

@cskunkun

Describe the bug
开发环境rspack css-in-js emotion 设置了autoLabel选项,但是实际展示的类名中还是类似css-14zxgb1,无法快速定位

URL to minimal reproduction
参考配置rsbuild.config.ts

import { defineConfig } from '@rsbuild/core';
import { pluginReact } from '@rsbuild/plugin-react';

// Docs: https://rsbuild.rs/config/
export default defineConfig({
  plugins: [
    pluginReact({
      swcReactOptions: {
        importSource: '@emotion/react',
      },
    }),
  ],
  tools: {
    swc: {
      jsc: {
        experimental: {
          plugins: [
            [
              '@swc/plugin-emotion',
              {
                autoLabel: 'always',
                sourceMap: true,
              },
            ],
          ],
        },
      },
    },
  },
});

export const testCls = css`
  font-size: 100px;

  font-weight: bold;
`;

Expected behavior
希望展示css类名为xxx-testCls

Additional context

Add any other context about the problem here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions