Javascript 网页包:导入CSS
我对CSS有一个问题。我正在使用,我想通过Javascript 网页包:导入CSS,javascript,webpack,fullcalendar,Javascript,Webpack,Fullcalendar,我对CSS有一个问题。我正在使用,我想通过import'@fullcalendar/core/main.CSS'在我的脚本中导入CSS 我有以下错误: Module parse failed: Unexpected character '@' (1:0) You may need an appropriate loader to handle this file type. @charset "UTF-8"; | .fc {
import'@fullcalendar/core/main.CSS'在我的脚本中导入CSS代码>
我有以下错误:
Module parse failed: Unexpected character '@' (1:0)
You may need an appropriate loader to handle this file type.
@charset "UTF-8";
| .fc {
| direction: ltr;
@ ./assets/js/admin/admin.js 4:0-37
谢谢你的帮助。下面的配置为我工作
module: {
rules: [{
test: /\.css$/,
use: [
'style-loader',
MiniCssExtractPlugin.loader,
{
loader: "css-loader",
options: {
minimize: true,
sourceMap: true
}
}
]
}
]
}
然后在js文件中导入类似的内容
import "css/Admin/admin.css";