使用 var atImport = require("postcss-import");的时候,报错:
Cannot read property 'length' of undefined]
应该把import写到文件头部就可以了。
除此之外,也可以使用precss来解决这个问题,
gulp.src("/main/*.css") .pipe(postcss([precss({import: {disable:false}})])) .pipe(gulp.dest("/min"));这样就不报错了
本文介绍了解决使用postcss-import时出现的'Cannot read property 'length' of undefined'错误的方法。一种解决方案是在文件头部使用import语句;另一种是通过配置precss来避免此错误。

1167

被折叠的 条评论
为什么被折叠?



