Answer the question
In order to leave comments, you need to log in
Postcss-import - how to inline styles?
I don't know much about postcss, need some help. The essence of the problem: the postcss-import plugin does not inline included files.
gulpfile.js snippet:
var gulp = require("gulp"),
cssimport = require("postcss-import"),
postcss = require("gulp-postcss");
gulp.task('styles', gulp.series(styles));
function styles() {
return gulp.src('src/assets/css/app.css')
.pipe(postcss(cssimport))
.pipe(gulp.dest('dist/assets/css'));
}
@import 'blocks/button/button.css';
@import 'blocks/button/button.css';
Answer the question
In order to leave comments, you need to log in
The question is irrelevant. It was in another plugin (postcss-csscomb) that was blocking the import. The script also did not work with the only postcss-import left, but, most likely, the cache was to blame - after a while everything worked as it should. And instead of postcss-csscomb put csslint+cssfmt.
You have connected the plugin incorrectly. Try like this
…
.pipe(postcss([ cssimport() ]))
…
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question