tonifisler/generator-styleguide

Adding polyfills

Closed this issue · 1 comments

Yago commented

What do you think about pre-adding Polyfills ?

bower.json

{
  "devDependencies": {
    "html5shiv": "3.7.2",
    "respond": "1.4.2"
  }
}

gulpfile.js (in vendors task)

  gulp.src([
      'bower_components/html5shiv/dist/html5shiv.js',
      'bower_components/respond/dest/respond.src.js'
    ])
    .pipe($.concat('polyfills.min.js'))
    .pipe($.uglify())
    .pipe(gulp.dest('build/js'));

In template

    <!--[if lt IE 9]>
      <script src="build/js/polyfills.js"></script>
    <![endif]-->

👍