我无法理解问题是什么以及如何解决它
https://github.com/LPGhatguy/postcss-sassy-import/blob/master/index.js#L72
Requiring external module babel-register
../node_modules/postcss-sassy-import/index.js:72
opts.loadPaths = [...defaultLoadPaths, ...paths];
^
TypeError: paths[Symbol.iterator] is not a function
我的gulp任务
var plugins = [
sassyImport({loadPaths: origin => path.join(process.cwd(), "/app/styles")}),
cssnext({browsers: ['last 2 version']}),
postcssmedia(),
];
gulp.task('styles', () => (
gulp.src('app/styles/app.sss')
.pipe(postcss(plugins, { parser: sugarss }))
.pipe(rename({suffix: '.min'}))
.pipe(gulp.dest('dist/assets/styles'))
));
答案 0 :(得分:1)
{loadPaths: origin => path.join(process.cwd(), "/app/styles")}
应该是
{loadPaths: [origin => path.join(process.cwd(), "/app/styles")]}
loadPaths
需要是一个数组。