Skip to content
amobiz edited this page Feb 25, 2016 · 3 revisions

Install gulp cli 4.0 globally

npm install -g "gulpjs/gulp-cli#4.0"

Install gulp 4.0 in your project's devDependencies

npm install --save-dev "gulpjs/gulp#4.0"

See this tutorial for detailed installation instructions.

Install gulp-chef in your project's devDependencies

$ npm install --save-dev gulp-chef

Create a gulpfile.js at the root of your project

var gulp = require('gulp');
var chef = require('gulp-chef');

var ingredients = {
    src: 'src/',
    dest: 'dist/',
    clean: {},
    make: {
        postcss: {
            src: 'styles.css',
            processors: {
                stylelint: {},
                import: {},
                cssnext: {
                    features: {
                        autoprefixer: {
                            browser: 'last 2 versions'
                        }
                    }
                },
                lost: {},
                production: {
                    cssnano: {}
                }
            }
        },
        browserify: {
            bundle: {
                entry: 'main.js',
                file: 'scripts.js',
                transform: ['stringify', 'browserify-shim'],
                production: {
                    uglify: true
                }
            }
        },
        assets: {
            src: [
                'index.html',
                'favicon.ico',
                'opensearch.xml'
            ],
            recipe: 'copy'
        }
    },
    build: ['clean', 'make'],
    default: 'build'
};

var meals = chef(ingredients);

gulp.registry(meals);

Run Gulp

$ gulp