sp-dev-fx-webparts/samples/react-tailwindcss/gulpfile.js

25 lines
694 B
JavaScript
Raw Normal View History

2020-10-17 10:30:38 -04:00
'use strict';
const build = require('@microsoft/sp-build-web');
build.addSuppression(`Warning - [sass] The local CSS class 'ms-Grid' is not camelCase and will not be type-safe.`);
// Step 1 + './src/tailwind.css' + './tailwind.config.js'
let tailwindBuild = build.subTask('build-tailwind', (gulp, buildOptions, done) => {
const postcss = require('gulp-postcss');
gulp.src(`${buildOptions.srcFolder}/tailwind.css`)
.pipe(postcss([
require('tailwindcss')('./tailwind.config.js'),
require('gulp-autoprefixer')
]))
.pipe(gulp.dest(buildOptions.libFolder));
done();
});
build.rig.addPostBuildTask(tailwindBuild);
// End Step 1
build.initialize(require('gulp'));