<NME> dev.js
<BEF> import gulp from 'gulp';
import loadPlugins from 'gulp-load-plugins';
import browserSync from 'browser-sync';
import flexbugs from 'postcss-flexbugs-fixes';
import autoprefixer from 'autoprefixer-core';

const $ = loadPlugins();
const bs = browserSync.create();
import source from 'vinyl-source-stream';
<% if (!includeReact) { -%>
import fs from 'fs';
import path from 'path';
import YAML from 'yamljs';
import fm from 'front-matter';
<% } -%>

const $ = loadPlugins();
const bs = browserSync.create();

let b = browserify({
<% if (includeReact) { -%>
  entries: ['./app/scripts/app.jsx'],
  extensions: ['.jsx'],
<% } else { -%>
  entries: ['./app/scripts/app.js'],
<% } -%>
  debug: true
}, watchify.args);

// only watch for changes in development mode
if (process.env.GULP_ENV !== 'production') {
  b = watchify(b);
}

function bundle() {
  return b.bundle()
    .on('error', (msg) => {
      delete msg.stream;
      $.util.log(msg);
    })
    .pipe(source('bundle.js'))
    .pipe(gulp.dest('.tmp/scripts'))
    .pipe(bs.stream({once: true}));
}

gulp.task('scripts', bundle);
b.on('update', bundle);

gulp.task('lint', () => {
  return gulp.src([
<% if (includeReact) { -%>
    'app/scripts/**/*.{js,jsx}',
    'test/**/*.{js,jsx}',
<% } else { -%>
    'app/scripts/**/*.js',
    'test/**/*.js',
<% } -%>
    'task/**/*.js'
  ])
    .pipe($.eslint())
    .pipe($.eslint.format())
    .pipe($.eslint.failAfterError());
});

<% if (!includeReact) { -%>
gulp.task('views', () => {
  // à la Data Files in Jekyll
  // http://jekyllrb.com/docs/datafiles/
  let data = {};
  fs.readdirSync('./data').forEach((file) => {
    data[path.basename(file, '.yml')] = YAML.load(`data/${file}`);
  });

  return gulp.src('app/views/**/*.html')
    .pipe($.plumber())
    .pipe($.data({site: {data: data}}))
    .pipe($.data((file) => {
      let content = fm(String(file.contents));
      file.contents = new Buffer(content.body);
      return {page: content.attributes};
    }))
    .pipe($.template())
    .pipe($.wrap({src: 'app/layouts/default.html'}))
    .pipe(gulp.dest('.tmp'))
    .pipe(bs.stream({once: true}));
});
<% } -%>

gulp.task('styles', () => {
  return gulp.src('app/styles/**/*.scss')
    .pipe($.plumber())
    .pipe($.sourcemaps.init())
    .pipe($.sass.sync()).on('error', $.sass.logError)
    .pipe($.postcss([
      flexbugs,
      autoprefixer
    ]))
    .pipe($.sourcemaps.write())
    .pipe(gulp.dest('.tmp/styles'))
    .pipe(bs.stream());
});

<% if (includeReact) { -%>
gulp.task('connect:dev', ['scripts', 'styles'], (done) => {
<% } else { -%>
gulp.task('connect:dev', ['scripts', 'views', 'styles'], (done) => {
<% } -%>
  bs.init({
    notify: false,
    port: 9000,
    open: false,
    server: {
      // the order is important, this way files in .tmp
      // will get precedence in case of a name clash
      baseDir: ['.tmp', 'app']
    }
  }, done);
});

gulp.task('watch:dev', ['connect:dev'], () => {
  gulp.watch([
<% if (includeReact) { -%>
    'app/index.html',
<% } -%>
    'app/images/**/*'
  ]).on('change', bs.reload);

  gulp.watch('app/styles/**/*.scss', ['styles']);
<% if (!includeReact) { -%>
  gulp.watch([
    'app/**/*.html',
    'data/**/*.yml'
  ], ['views']);
<% } -%>
});

gulp.task('serve:dev', ['connect:dev', 'watch:dev']);

<MSG> Update PostCSS

Fixes #29.

<DFF> @@ -2,7 +2,7 @@ import gulp from 'gulp';
 import loadPlugins from 'gulp-load-plugins';
 import browserSync from 'browser-sync';
 import flexbugs from 'postcss-flexbugs-fixes';
-import autoprefixer from 'autoprefixer-core';
+import autoprefixer from 'autoprefixer';
 
 const $ = loadPlugins();
 const bs = browserSync.create();

{'commit': 'diff --git a/generators/app/templates/_package.json b/generators/app/templates/_package.json\nindex aeee463..9d57bc7 100644\n--- a/generators/app/templates/_package.json\n+++ b/generators/app/templates/_package.json\n@@ -23,7 +23,7 @@\n   },\n   "browserify-shim": {},\n   "devDependencies": {\n-    "autoprefixer-core": "^5.2.0",\n+    "autoprefixer": "^6.0.3",\n     "babel-core": "^5.6.18",\n     "babelify": "^6.1.3",\n     "browser-sync": "^2.7.12",\n@@ -47,7 +47,7 @@\n     "gulp-load-plugins": "^1.0.0-rc.1",\n     "gulp-minify-css": "^1.1.6",\n     "gulp-plumber": "^1.0.1",\n-    "gulp-postcss": "^5.1.8",\n+    "gulp-postcss": "^6.0.0",\n     "gulp-sass": "^2.0.1",\n     "gulp-size": "^1.2.1",\n     "gulp-sourcemaps": "^1.5.2",\ndiff --git a/generators/app/templates/task/dev.js b/generators/app/templates/task/dev.js\nindex b2a7aeb..7244c3e 100644\n--- a/generators/app/templates/task/dev.js\n+++ b/generators/app/templates/task/dev.js\n@@ -2,7 +2,7 @@ import gulp from \'gulp\';\n import loadPlugins from \'gulp-load-plugins\';\n import browserSync from \'browser-sync\';\n import flexbugs from \'postcss-flexbugs-fixes\';\n-import autoprefixer from \'autoprefixer-core\';\n+import autoprefixer from \'autoprefixer\';\n \n const $ = loadPlugins();\n const bs = browserSync.create();\n', 'commit_subject': 'Update PostCSS', 'repo_name': 'silvenon/generator-wbp', 'committer': {'name': 'Matija Marohnić', 'email': 'c03a0c22755896c34facb3c8528ec0e671db8b76@gmail.com', 'time_sec': '1443383954', 'tz_offset': '120', 'date': {'seconds': '1443383954'}}, 'commit_tree': '0df7252319fb0648631eeb54cf628e52fe8e9ae6', 'commit_message': 'Update PostCSS\n\nFixes #29.\n', 'language_name': 'HTML', 'license': 'mit', 'hunks': "@@ -2,7 +2,7 @@ import gulp from 'gulp';\n import loadPlugins from 'gulp-load-plugins';\n import browserSync from 'browser-sync';\n import flexbugs from 'postcss-flexbugs-fixes';\n-import autoprefixer from 'autoprefixer-core';\n+import autoprefixer from 'autoprefixer';\n \n const $ = loadPlugins();\n const bs = browserSync.create();\n", 'addition_count': 1, 'deletion_count': 1, 'src_file': 'a/generators/app/templates/task/dev.js', 'tgt_file': 'b/generators/app/templates/task/dev.js', 'file_extension': '.js', 'before_file': "import gulp from 'gulp';\nimport loadPlugins from 'gulp-load-plugins';\nimport browserSync from 'browser-sync';\nimport flexbugs from 'postcss-flexbugs-fixes';\nimport autoprefixer from 'autoprefixer-core';\n\nconst $ = loadPlugins();\nconst bs = browserSync.create();\nimport source from 'vinyl-source-stream';\n<% if (!includeReact) { -%>\nimport fs from 'fs';\nimport path from 'path';\nimport YAML from 'yamljs';\nimport fm from 'front-matter';\n<% } -%>\n\nconst $ = loadPlugins();\nconst bs = browserSync.create();\n\nlet b = browserify({\n<% if (includeReact) { -%>\n  entries: ['./app/scripts/app.jsx'],\n  extensions: ['.jsx'],\n<% } else { -%>\n  entries: ['./app/scripts/app.js'],\n<% } -%>\n  debug: true\n}, watchify.args);\n\n// only watch for changes in development mode\nif (process.env.GULP_ENV !== 'production') {\n  b = watchify(b);\n}\n\nfunction bundle() {\n  return b.bundle()\n    .on('error', (msg) => {\n      delete msg.stream;\n      $.util.log(msg);\n    })\n    .pipe(source('bundle.js'))\n    .pipe(gulp.dest('.tmp/scripts'))\n    .pipe(bs.stream({once: true}));\n}\n\ngulp.task('scripts', bundle);\nb.on('update', bundle);\n\ngulp.task('lint', () => {\n  return gulp.src([\n<% if (includeReact) { -%>\n    'app/scripts/**/*.{js,jsx}',\n    'test/**/*.{js,jsx}',\n<% } else { -%>\n    'app/scripts/**/*.js',\n    'test/**/*.js',\n<% } -%>\n    'task/**/*.js'\n  ])\n    .pipe($.eslint())\n    .pipe($.eslint.format())\n    .pipe($.eslint.failAfterError());\n});\n\n<% if (!includeReact) { -%>\ngulp.task('views', () => {\n  // à la Data Files in Jekyll\n  // http://jekyllrb.com/docs/datafiles/\n  let data = {};\n  fs.readdirSync('./data').forEach((file) => {\n    data[path.basename(file, '.yml')] = YAML.load(`data/${file}`);\n  });\n\n  return gulp.src('app/views/**/*.html')\n    .pipe($.plumber())\n    .pipe($.data({site: {data: data}}))\n    .pipe($.data((file) => {\n      let content = fm(String(file.contents));\n      file.contents = new Buffer(content.body);\n      return {page: content.attributes};\n    }))\n    .pipe($.template())\n    .pipe($.wrap({src: 'app/layouts/default.html'}))\n    .pipe(gulp.dest('.tmp'))\n    .pipe(bs.stream({once: true}));\n});\n<% } -%>\n\ngulp.task('styles', () => {\n  return gulp.src('app/styles/**/*.scss')\n    .pipe($.plumber())\n    .pipe($.sourcemaps.init())\n    .pipe($.sass.sync()).on('error', $.sass.logError)\n    .pipe($.postcss([\n      flexbugs,\n      autoprefixer\n    ]))\n    .pipe($.sourcemaps.write())\n    .pipe(gulp.dest('.tmp/styles'))\n    .pipe(bs.stream());\n});\n\n<% if (includeReact) { -%>\ngulp.task('connect:dev', ['scripts', 'styles'], (done) => {\n<% } else { -%>\ngulp.task('connect:dev', ['scripts', 'views', 'styles'], (done) => {\n<% } -%>\n  bs.init({\n    notify: false,\n    port: 9000,\n    open: false,\n    server: {\n      // the order is important, this way files in .tmp\n      // will get precedence in case of a name clash\n      baseDir: ['.tmp', 'app']\n    }\n  }, done);\n});\n\ngulp.task('watch:dev', ['connect:dev'], () => {\n  gulp.watch([\n<% if (includeReact) { -%>\n    'app/index.html',\n<% } -%>\n    'app/images/**/*'\n  ]).on('change', bs.reload);\n\n  gulp.watch('app/styles/**/*.scss', ['styles']);\n<% if (!includeReact) { -%>\n  gulp.watch([\n    'app/**/*.html',\n    'data/**/*.yml'\n  ], ['views']);\n<% } -%>\n});\n\ngulp.task('serve:dev', ['connect:dev', 'watch:dev']);\n", 'message': 'Update PostCSS\n\nFixes #29.\n', 'author_name': 'Matija Marohnić', 'lang': 'js'}