我使用的WebPack从节点模块onsenui加载CSS文件:如何配置webpack加载导入css文件的css?
require('onsenui/css/onsenui.css');
require('onsenui/css/onsen-css-components.css');
文件onsenui/CSS/onsenui.css确实进口相对的CSS文件:
@import url("font_awesome/css/font-awesome.min.css");
@import url("ionicons/css/ionicons.min.css");
@import url("material-design-iconic-font/css/material-design-iconic-font.min.css");
随着一个webpack配置如下:
module: {
loaders: [
{
test: /\.js$/,
loaders: [ 'babel' ],
exclude: /node_modules/,
include: __dirname
},
{
test: /\.css?$/,
loaders: [ 'style', 'css'],
include: __dirname
}
]
}
但是我g等浏览器中的以下错误:
http://localhost:9001/font_awesome/css/font-awesome.min.css Failed to load resource: the server responded with a status of 404 (Not Found)
http://localhost:9001/material-design-iconic-font/css/material-design-iconic-font.min.css Failed to load resource: the server responded with a status of 404 (Not Found)
http://localhost:9001/ionicons/css/ionicons.min.css Failed to load resource: the server responded with a status of 404 (Not Found)
是否CSS-装载机无法处理@import
报表?我应该如何解决@import url(...)
阶段的加载?我can'r从node_modules重写CSS文件...