看了css-loader文档于是想试一下https://www.webpackjs.com/loa...使用vue-cli3搭建的项目配置代码css:{loaderOptions:{css:{alias:{'@css':path.join(__dirname,'src','css'),}},}},项目中的使用 @import"@css/common.postcss";.wrap{padding:var(--common-space);&.contain{background:var(--common-background);padding:var(--common-fill);}}报错信息errorin./src/views/job-management/report/completeness/index.vue?vue&type=style&index=0&id=464df02c&lang=postcss&scoped=true&Modulebuildfailed(from../node_modules/postcss-loader/src/index.js):Error:Failedtofind'@css/common.postcss'in[E:\数据资产项目\数据资产项目-前台\datamanagement\vue_project\data_quality\src\views\job-management\report\completeness]atresolveModule.catch.catch(E:\数据资产项目\数据资产项目-前台\datamanagement\vue_project\node_modules\postcss-import\lib\resolve-id.js:35:13)at 跳过postcss-loader同样报错,不过报的错不一样了报错信息Thisdependencywasnotfound:*-!../../../../../../node_modules/css-loader/index.js??ref--6-oneOf-1-1!../../../../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!./@css/test.cssin../node_modules/css-loader??ref--6-oneOf-1-1!../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../node_modules/cache-loader/dist/cjs.js??ref--0-0!../node_modules/vue-loader/lib??vue-loader-options!./src/views/job-management/report/completeness/index.vue?vue&type=style&index=0&lang=css&Toinstallit,youcanrun:npminstall--save-!../../../../../../node_modules/css-loader/index.js??ref--6-oneOf-1-1!../../../../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!./@css/test.css
蓝山帝景
慕运维8079593
相关分类