尝试从CSS中排除node_modules会导致“需要适当的加载器”错误

时间:2019-08-05 12:00:34

标签: webpack webpack-style-loader css-loader

我正在尝试排除无用的CSS,这些CSS在使用webpack的最终版本中给我造成了问题。

Webpack版本:4.28.4

进行编译时会引发以下错误:

Im an UIView
Im an UIView
im an UILabel
im an UIImageView

但是,如果我从规则中删除ERROR in ./node_modules/antd/lib/tooltip/style/index.css 4:0 Module parse failed: Unexpected token (4:0) You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders |/* stylelint-disable declaration-bang-space-before */ | /* stylelint-disable declaration-bang-space-before */ > .ant-tooltip { | position: absolute; | z-index: 1060; ℹ 「wdm」: Failed to compile ,它将很好地进行编译。它只是将所有无用的CSS包含在最终版本中。

CSS设置:

exclude

我希望最终结果不会将所有的node_modules CSS文件添加到我的版本中,但是在这里,我天真地希望事情会变得如此简单。

0 个答案:

没有答案
相关问题