Skip to content

Commit

Permalink
babel, uglify, and eslint fallback support
Browse files Browse the repository at this point in the history
  • Loading branch information
makemek committed Feb 22, 2017
1 parent cb2e7fe commit c2ebbbe
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 2 deletions.
3 changes: 3 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"presets": ["env"]
}
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.min.js
8 changes: 7 additions & 1 deletion gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,12 @@ const cleanCSS = require('gulp-clean-css')
const rename = require('gulp-rename')
const bs = require('browser-sync').create()
const nodemon = require('gulp-nodemon')
const uglify = require('gulp-uglify')
const babel = require('gulp-babel')
const gutil = require('gulp-util')
const source = require('vinyl-source-stream')
const browserify = require('browserify')
const buffer = require('vinyl-buffer')

gulp.task('build', ['build:css', 'build:js'])

Expand All @@ -38,7 +41,10 @@ gulp.task('build:js', () => {
browserify('src/views/js/')
.bundle()
.on('error', error => gutil.log(error))
.pipe(source('bundle.js'))
.pipe(source('bundle.min.js'))
.pipe(buffer())
.pipe(babel())
.pipe(uglify())
.pipe(gulp.dest(destination.js))
.pipe(bs.stream())
})
Expand Down
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
"devDependencies": {
"app-root-path": "2.0.1",
"autoprefixer": "6.7.0",
"babel": "6.23.0",
"browser-sync": "2.18.6",
"browserify": "14.1.0",
"cheerio": "0.22.0",
Expand All @@ -71,6 +72,8 @@
"slash": "1.0.0",
"supertest": "2.0.1",
"supertest-as-promised": "4.0.2",
"uglify": "0.1.5",
"vinyl-buffer": "1.0.0",
"vinyl-source-stream": "1.1.0"
}
}
4 changes: 4 additions & 0 deletions src/views/js/lib-fallback.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/* global fallback */

'use strict'

require('fallbackjs/fallback.min')

fallback.load({
Expand Down
2 changes: 1 addition & 1 deletion src/views/layouts/defaultLayout.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

<body>
{{{body}}}
<script src="js/bundle.js"></script>
<script src="js/bundle.min.js"></script>
</body>

</html>

0 comments on commit c2ebbbe

Please sign in to comment.