Fórum

Autoprefixer Liferay 7 Gulp

thumbnail
Marco Endres, modificado 7 Anos atrás.

Autoprefixer Liferay 7 Gulp

Regular Member Postagens: 112 Data de Entrada: 22/08/12 Postagens Recentes
Hey guys

I tried to add an autoprefixer to the gulp-chain, after he builded the main.css Thats what I have so far:

'use strict';

var gulp = require('gulp'),
    liferayThemeTasks = require('liferay-theme-tasks');
const autoprefixer = require('gulp-autoprefixer');

var cssFiles = 'build/css/main.css',
    cssDest = 'build/css';

liferayThemeTasks.registerTasks({
    gulp: gulp,
    hookFn: function(gulp) {
        gulp.hook('after:build', function(done) {
            return gulp.src(cssFiles)
                .pipe(autoprefixer({
                    browsers: ['last 20 versions'],
                    cascade: false
                }))
                .on('end', done);
        });
    }
});


How do i get the builded files right and how to i write it?
thumbnail
Robert Frampton, modificado 7 Anos atrás.

RE: Autoprefixer Liferay 7 Gulp (Resposta)

New Member Postagens: 12 Data de Entrada: 26/09/12 Postagens Recentes
Hi Marco,

Take a look at gulp's documentation for the gulp.dest method. That is the most common way of writing files from a gulp pipeline.

You'll also have to hook a different task in order for this to work, as the .war file will have already been created. Try this instead.


gulp.hook('before:build:war', function(done) {
  // hook
});


Hope that helps!