Code Monkey home page Code Monkey logo

Comments (6)

greypants avatar greypants commented on September 28, 2024

It's on my to-do list to add a production task that includes minification. I use gulp-uglify and gulp-minify-css on most of my projects.

Also, check out mod_pagespeed - you can configure your server to handle this and a ton of other optimizations for you.

from blendid.

anishjajodia avatar anishjajodia commented on September 28, 2024

I would love to see this repo with those modules of minification and concatenation.

+1 to that.

from blendid.

greypants avatar greypants commented on September 28, 2024

Here's a basic production task setup I've used in the past:

var gulp      = require('gulp');
var config    = require('../config').production;
var minifyCSS = require('gulp-minify-css');
var uglify    = require('gulp-uglify');

gulp.task('flagProduction', function(){
  global.isProduction = true
});

gulp.task('minifyCSS', ['sass'], function() {
  return gulp.src(config.cssSrc)
    .pipe(minifyCSS({keepBreaks:true}))
    .pipe(gulp.dest(config.dest))
})

gulp.task('uglifyJS', ['browserify'], function() {
  return gulp.src(config.jsSrc)
    .pipe(uglify())
    .pipe(gulp.dest(config.dest))
})

gulp.task('production', ['flagProduction', 'minifyCSS', 'uglifyJS']);

from blendid.

greypants avatar greypants commented on September 28, 2024

I use the global.isProduction flag in other tasks to determin whether or not to include source maps or use watchify

from blendid.

pBun avatar pBun commented on September 28, 2024

I have a modified version of this repo with which I use minification in production.

My heroku/dokku production task sets a variable which tells the browserify task to minify with gulp-uglify and css variant tasks (ex: the stylus task) to minify with gulp-minify-css.

from blendid.

anishjajodia avatar anishjajodia commented on September 28, 2024

@pBun. Surely will look at that.

Thanks mate

from blendid.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.