美文网首页
Error: No PostCSS Config found i

Error: No PostCSS Config found i

作者: drneilc | 来源:发表于2022-06-15 14:48 被阅读0次

自己开发的npm包在项目中引用的时候,提示Error: No PostCSS Config found in...,查看一些帖子说在项目里新建postcss.config.js,把autoprefixer配置加上,

module.exports = { 
  plugins: { 
    'autoprefixer': {browsers: 'last 5 version'} 
  } 
}

然而。。。并不生效,报错位置说是包的lib目录不存在,尝试在包的项目里加配置,


image.png

额。。。autoprefixer不存在,还需要重新安装依赖,于是我把内容注释了,重新打包。。。正常了

https://github.com/browserslist/browserslist#readme

结论

github里的介绍说可以再package.json里配置,但是尝试了之后并没有生效,目前可行的是新建一个空的postcss.config.js即可。

相关文章

网友评论

      本文标题:Error: No PostCSS Config found i

      本文链接:https://www.haomeiwen.com/subject/jfsxvrtx.html