M
M
Mikhail Rudenko2015-03-28 13:02:10
gulp.js
Mikhail Rudenko, 2015-03-28 13:02:10

What is gulp plugin for obfuscation of html code?

I tried this one https://www.npmjs.com/package/gulp-obfuscate and it doesn't work, it only acts on js files, here is my gulpfile.js

var gulp = require('gulp'),
  uglify = require('gulp-uglify'),
  sass = require('gulp-sass'),
  plumber = require('gulp-plumber'),
  livereload = require('gulp-livereload'),
  prefix = require('gulp-autoprefixer'),
  jade = require('gulp-jade'),
  obfuscate = require('gulp-obfuscate'),
  concatCss = require('gulp-concat-css'),
  minifyCSS = require('gulp-minify-css');
  // jadephp = require('gulp-jade-php');


//Scripts Task
//Uglifies
gulp.task('scripts',function(){
  gulp.src('js/*.js')
    .pipe(plumber())
    .pipe(uglify())
    .pipe(gulp.dest('output/minjs'));
});

//Styles Task
//Sass
gulp.task('sass',function(){
  gulp.src('scss/**/*.scss')
    .pipe(plumber())
    .pipe(sass({
      style: 'compressed' // is not working 
    }))
    .pipe(prefix('last 10 versions'))
    .pipe(obfuscate())
    .pipe(gulp.dest('output/css/'))
    .pipe(livereload());
});

//Minify css

gulp.task('minifycss',function(){
  gulp.src('output/css/*.css')
  .pipe(minifyCSS({keepBreaks:false}))
  .pipe(gulp.dest('output/css/'))
});

//Watch Task JS,Sass,Jade
gulp.task('watch',function(){
  livereload.listen();
  gulp.watch('js/*.js', ['scripts'])  //**.*.js
  gulp.watch('scss/**/*.scss', ['sass']);
  gulp.watch('jade/*.jade', ['jade']);
  gulp.watch('output/css/*.css',['minifycss']);
});


//Simple Jade task
gulp.task('jade', function() {
  gulp.src('jade/*.jade')
  	.pipe(plumber())
    .pipe(jade())
    //.pipe(obfuscate())
    .pipe(gulp.dest('output'))
});



//Obfuscate html
gulp.task('obfuscate', function () {
     gulp.src('output/*.html')
        .pipe(obfuscate());
});

gulp.task('default',['scripts','sass','jade','minifycss','obfuscate','watch']);

Answer the question

In order to leave comments, you need to log in

2 answer(s)
M
Mikhail Rudenko, 2015-03-28
@balion

like this
eywXRywHRywnQywXcywXMywXexwHexw3dxwndxwnexwXQxwHRxw3QxwnQxwXdxw3cxw3NywXbxwHbxw3axw3MywnbxwHdxw3bxwncxwXcxwHcxwXRxwnRxwXVxwHfUFDfTFDfSFDfWFDfyIDfaFDfwIDfnwFXcxCWxwSUxwyJcxFX7kSKshyYxgSWuE2OpkGK0EjLvtTXwsVKnwFXcxFXcx1dnwFXcxFXcxFKzEjLh1zbgg2OpETMuEGK5tyJcxFXcxFXc1jWmcCXcxFXcxFXrkiZx4SYok3KnwFXcxFXcxVPnFjJnwFXcxFXcx1KnwFXcxFXcxVQ9Q0PvgkLX9yL6EWMnwFXcxFXcxVPlFjLptTKnwFXcxFXcxVOnwFXcxFXcxFKwEjLh1Tagg2OnwFXcxFXcxlMlkzL2UiMlg1L2UCNlITJ1EzL2USMlETJxUSMlQTJyUSOvYTJyUyMlQmL2EzLj9yMlUTJmViYlETJxUSMlETJxUSMlETJxUCNlITJ58iNlITJzUCZuITMvM2LzUS

I
Ivan, 2015-04-04
@redbis

Because:

gulp plugin to obfuscate your code using gulp-regex-replace

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question