[英]Vue CLI - No PostCSS config found
我有一个 package.json 是这样的:
{
"name": "dashboard",
"version": "0.1.0",
"private": true,
"scripts": {
"serve": "vue-cli-service serve",
"build": "vue-cli-service build",
"lint": "vue-cli-service lint"
},
"dependencies": {
"apexcharts": "^3.8.4",
"axios": "^0.19.0",
"core-js": "^2.6.5",
"lodash": "^4.17.15",
"moment": "^2.24.0",
"vue": "^2.6.10",
"vue-apexcharts": "^1.5.1",
"vue-numerals": "^3.0.5",
"vue-router": "^3.1.3",
"vue-virtual-scroll-list": "^1.4.4",
"vuetify": "2.1.13",
"vuex": "^3.1.2",
"vuex-map-fields": "^1.3.6",
"vuex-persist": "^2.2.0"
},
"devDependencies": {
"@mdi/font": "^3.8.95",
"@vue/cli-plugin-babel": "^3.9.0",
"@vue/cli-plugin-eslint": "^3.9.0",
"@vue/cli-service": "^3.9.0",
"babel-eslint": "^10.0.1",
"eslint": "^5.16.0",
"eslint-plugin-vue": "^5.0.0",
"sass": "^1.17.4",
"sass-loader": "^7.1.0",
"typeface-roboto": "^0.0.75",
"vue-cli-plugin-vuetify": "^2.0.5",
"vue-template-compiler": "^2.6.10",
"vuetify-loader": "^1.2.2"
}
}
当我通过 Vue cli 对该项目进行设置时,我选择了 Eslint、Babel 等选项被封装在 package.json 中。 我现在将它们放在几个文件中: .eslintrc.js
、 babel.config.js
和postcss.config.js
。 我可以这样做 - 创建这些文件并从 package.json 中删除内容吗?
postcss.config.js
的内容是这样的:
module.exports = {
plugins: {
autoprefixer: {},
},
};
当我构建它时,我总是收到以下消息:
Module build failed (from ./node_modules/postcss-loader/src/index.js):
Error: No PostCSS Config found in: /Users/dev/Sites/dev/src/node_modules/vuetify/src/directives/ripple
at /Users/dev/Sites/dev/src/resources/views/dashboard/node_modules/postcss-load-config/src/index.js:91:15
@ /Users/dev/Sites/dev/src/node_modules/vuetify/src/directives/ripple/VRipple.sass 4:14-329 14:3-18:5 15:22-337
在此之前,我在顶部看到此消息:
65% building 852/919 modules 67 active /Users/dev/Sites/dev/src/resources/views/dashboard/node_modules/axios/lib/core/transformData.jsYou did not set any plugins, parser, or stringifier. Right now, PostCSS does nothing. Pick plugins for your case on https://www.postcss.parts/ and use them in postcss.config.js.
这是否意味着我也需要在package.json
中使用postcss.config.js
中指定的 sass-loader? 我有点困惑,因为在另一个项目中我有相同的配置,而postcss.config.js
中没有其他内容,而且我没有收到有关缺少插件的错误消息。 谢谢!
我建议你尝试在控制台中启动vue ui
。 之后在“依赖项”类别中,您必须尝试卸载 CSS 处理器的软件包,然后重新安装它。
可能其中一些软件包已损坏。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.