Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

微模块打包后使用时@alifd/next/icon主题样式缺失 #687

Open
caojinjie opened this issue Jun 21, 2023 · 1 comment
Open

微模块打包后使用时@alifd/next/icon主题样式缺失 #687

caojinjie opened this issue Jun 21, 2023 · 1 comment

Comments

@caojinjie
Copy link

问题:

  1. 使用微模块脚手架进行微模块组件编码,使用自定义的Fusion主题包,主题包中包含自定义的Icon图标,在组件js中引用该图标;
    image
  2. 通过modules形式分包构建该组件,打包后查看build/组件名/index.scss,其中缺少icon图标:before样式;
    image
  3. 通过主应用调用形式加载组件的js和css,加载后图标无法显示,icon没有:before样式;
    image
  4. 查看组件的build文件夹,发现IP_legend_icon_gateway样式在build/index.css中,而不在build/组件目录/index.css中,实际在工程使用中不会引用build/index.css;
    image

期望

  1. 期望在分包打包后,样式能够全部打到build/组件目录/index.css中,不丢失样式;

延申

  1. 测试发现如果在build.json中不适用modules形式做分包加载,直接打包时,在产物build/index/index.css中样式是全的,其中包含了IP_legend_icon_gateway图标的:before样式;
  2. 怀疑可能是build-plugin-stark-module插件在modules下存在的问题;
@caojinjie
Copy link
Author

caojinjie commented Jun 21, 2023

微模块组件Demo如下:
micro-module.zip

@ClarkXia

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant