web-infra-dev / modern.js

A progressive web framework based on React and Rsbuild.
https://modernjs.dev/en/
MIT License
4.46k stars 369 forks source link

[Bug]: modern.js module 按照官网示例添加tailwindcss和storybook后不生效 #5732

Open CraxGrix opened 6 months ago

CraxGrix commented 6 months ago

Version

System:
    OS: Linux 6.5 Ubuntu 22.04.4 LTS 22.04.4 LTS (Jammy Jellyfish)
    CPU: (12) x64 12th Gen Intel(R) Core(TM) i5-12400F
    Memory: 43.36 GB / 62.63 GB
    Container: Yes
    Shell: 5.1.16 - /bin/bash
  Browsers:
    Chrome: 124.0.6367.60
  npmPackages:
    @modern-js/eslint-config: 2.49.3 => 2.49.3 
    @modern-js/module-tools: 2.49.3 => 2.49.3 
    @modern-js/plugin-tailwindcss: 2.49.3 => 2.49.3 
    @modern-js/storybook: 2.49.3 => 2.49.3

Details

已按照文档步骤将Storybook和TailwindCSS添加到同一个项目中,但是在组件内使用TailwindCSS的class后并未按期于Storybook中显示。经检查dist文件内含有treeshaking后的css类

Reproduce link

None

Reproduce Steps

  1. npm run storybook
  2. npm run build:watch
  3. stories内的文件引入打包后的dist文件
JeeSoonng commented 5 months ago

我也遇到了同样的问题,请问有解决办法了吗