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

按需加载的路由组件内部的antd样式build时失效 #130

Open
tangkai123456 opened this issue May 12, 2017 · 7 comments
Open

按需加载的路由组件内部的antd样式build时失效 #130

tangkai123456 opened this issue May 12, 2017 · 7 comments

Comments

@tangkai123456
Copy link

运行

yarn run build

使用getComponent加载的路由组件内的antd组件css不会被打包。但在index.js中import的组件的antd的css会正常打包

@Jungley8
Copy link

Jungley8 commented Jun 8, 2017

我也出现这个问题 ,解决了没?

--- 解决了 webpack.config.dev.js webpack.config.prod.js 两个文件都要加

@nalantianyi
Copy link

同求,code splitting后的路由组件中,使用extract-text-webpack-plugin后css没有被打包,js是正常的,没有异步加载的组件中,css和js都是正常的,发现这个问题,在antd的issue区 也反复有人提及,始终没有解决

@afc163
Copy link
Contributor

afc163 commented Jun 20, 2017

@nalantianyi
Copy link

@afc163 感觉这两个根本就不是一个问题。

@sym900728
Copy link

@nalantianyi 我也遇到同样的问题。
css 根本就没有被打包就来。而且用 import { Button } from ‘antd’ 包反而比 import Button from 'antd/lib/button' 打出来的包变大了。

@nalantianyi
Copy link

@sym900728 你的问题我估计是babel-plugin-import的配置问题,这个插件没有生效的情况下肯定是前者写法比后者要大的。因为全部打包了。
我提出的问题,后来发现是因为extract-text-webpack-plugin和webpack的code spliting导致的。

@ForeverPx
Copy link

同样遇到这个问题,求解决方法

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

6 participants