ERROR in ./src/css/1.css 1:2
Module parse failed: Unexpected token (1:2)
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
> li{
| list-style: none;
| }
@ ./src/index.js 2:0-21
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! webpack123@1.0.0 dev: `webpack --mode development`
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the webpack123@1.0.0 dev script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Administrator\AppData\Roaming\npm-cache\_logs\2021-04-27T07_29_37_209Z-debug.log
D:\develop\html\vue\stud_webpack>
以上是报错的显示
module.exports = {
mode: 'development',//在这里有development开发和production压缩成品两种选项
module: {
rules: [
{ test: /\.css$/, use: ['style-loader', 'css-loader'] }]
}
}
这个是webpack的配置
import $ from 'jquery';
import './css/1.css';
$(function () {
$('li:odd').css('backgroundColor', 'black');
$('li:even').css('backgroundColor', 'skyblue');
})
以上这个是index.js文件,我是按照视频上写的,我就是想知道为什么?