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

请问webpack4配置中的css的treeShaking 怎么配置 #1

Closed
383366204 opened this issue Jun 4, 2018 · 2 comments
Closed

请问webpack4配置中的css的treeShaking 怎么配置 #1

383366204 opened this issue Jun 4, 2018 · 2 comments

Comments

@383366204
Copy link

我用PurifyCssPlugin这个插件,这样写
new PurifyCssPlugin({
paths:glob.sync(path.join(__dirname,'../src/html/*.html')),//html模板的目录
})
但是生成出来的css把引用了的样式也删除了

@wlx200510
Copy link
Owner

wlx200510 commented Jun 4, 2018

引用的样式是指通过import引入的吗?是否已用postcss处理过?
把new ExtractTextPlugin 放在new PurifyCSSPlugin之前试一试

@383366204
Copy link
Author

似乎PurifyCSSPlugin一定要配合ExtractTextPlugin 一起使用,我用MiniCssExtractPlugin不行

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

2 participants