From 92b5e735b67f44103efa600d533c83240bb3d591 Mon Sep 17 00:00:00 2001 From: Johan Ronsse Date: Thu, 17 Jun 2021 17:30:15 +0200 Subject: [PATCH] Make things configurable; so you can add Tailwind if you really feel the need, in a config file that it outside of Bedrock core --- core/tasks/postcss.js | 12 +++++------- postcss.config.js | 4 ++++ 2 files changed, 9 insertions(+), 7 deletions(-) create mode 100644 postcss.config.js diff --git a/core/tasks/postcss.js b/core/tasks/postcss.js index bf64c8c..cf2f22d 100644 --- a/core/tasks/postcss.js +++ b/core/tasks/postcss.js @@ -2,20 +2,18 @@ const gulp = require('gulp'); const postcss = require('gulp-postcss'); // Plugins -const autoprefixer = require('autoprefixer'); -const atImport = require("postcss-import"); const paths = require('../paths'); -const config = require('../../bedrock.config'); +const bedrockConfig = require('../../bedrock.config'); +const postCSSPluginConfig = require('../../postcss.config'); + const { content } = require('../paths'); module.exports = function () { - var plugins = [ atImport, autoprefixer ]; - - if (config.cssCompiler == 'postcss') { + if (bedrockConfig.cssCompiler == 'postcss') { return gulp.src(paths.content.postcss.allMainFiles) - .pipe(postcss(plugins)) + .pipe(postcss(postCSSPluginConfig)) .on('error', (err) => console.error(err)) .pipe(gulp.dest(paths.compiled.css)); } else { diff --git a/postcss.config.js b/postcss.config.js new file mode 100644 index 0000000..e8f1d36 --- /dev/null +++ b/postcss.config.js @@ -0,0 +1,4 @@ +const atImport = require('postcss-import'); +const autoprefixer = require('autoprefixer'); + +module.exports = [atImport, autoprefixer]; \ No newline at end of file