我使用的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文件...