Failed to load PostCSS config: Failed to load PostCSS config (****):: [ReferenceError] module is not
Failed to load PostCSS config: Failed to load PostCSS config (****)::[ReferenceError] module is not defined in ES module scopeThis file is being treated as an ES module because it has a '.js' file ext
·
1、项目安装postcss然后配置postcss.config.js重启项目报错
2、解决方法
postcss默认导出样式是通过module.exports = {**},但是目前page.json文件中都会默认配置"type":"module",这样则需要使用在js文件导入导出用import 和export,也可以使用将page.json中"type":"module"去掉,然后在js文件导入导出用module.export 和 require,然后重启项目就可以了,下面是我的配置文件,使用es6中的默认导出
更多推荐
所有评论(0)