Commit fc22f5a2 authored by David Haynes's avatar David Haynes 🙆

Mash everything into one masonstrap.min.js

- woot
parent 94f94cab
Pipeline #1862 passed with stages
in 1 minute and 25 seconds
...@@ -9,6 +9,8 @@ const rename = require("gulp-rename"); ...@@ -9,6 +9,8 @@ const rename = require("gulp-rename");
const imagemin = require('gulp-imagemin'); const imagemin = require('gulp-imagemin');
const merge = require('merge-stream'); const merge = require('merge-stream');
const connect = require('gulp-connect'); const connect = require('gulp-connect');
const concat = require('gulp-concat')
const minify = require('gulp-minify');
// Reusable directories // Reusable directories
const src = './src' const src = './src'
...@@ -39,19 +41,11 @@ gulp.task('img', () => gulp.src(src + '/img/*').pipe(connect.reload()) ...@@ -39,19 +41,11 @@ gulp.task('img', () => gulp.src(src + '/img/*').pipe(connect.reload())
.pipe(gulp.dest(dest + '/img/')) .pipe(gulp.dest(dest + '/img/'))
); );
// Move required js files to build/js // Build masonstrap.min.js
gulp.task('js', () => { gulp.task('js', () => gulp.src(['./node_modules/jquery/dist/jquery.min.js', './node_modules/bootstrap/dist/js/bootstrap.bundle.min.js', src + '/js/*.js'])
let bootstrap = gulp.src('./node_modules/bootstrap/dist/js/bootstrap.bundle.min.js') .pipe(concat('masonstrap.js'))
.pipe(gulp.dest(dest + '/js/')) .pipe(minify({ext: ".min.js"}))
.pipe(gulp.dest(dest + '/js/')));
let jquery = gulp.src('./node_modules/jquery/dist/jquery.min.js')
.pipe(gulp.dest(dest + '/js/'))
let masonstrap = gulp.src(src + '/js/*.js')
.pipe(gulp.dest(dest + '/js/'))
return merge(bootstrap, jquery, masonstrap).pipe(connect.reload())
});
// Compile, autoprefix, minify scss with sourcemaps // Compile, autoprefix, minify scss with sourcemaps
gulp.task('sass', () => gulp.src(src + '/scss/*.scss').pipe(connect.reload()) gulp.task('sass', () => gulp.src(src + '/scss/*.scss').pipe(connect.reload())
......
...@@ -77,7 +77,6 @@ ...@@ -77,7 +77,6 @@
</body> </body>
<!-- load in external js --> <!-- load in external js -->
<script src="./js/jquery.min.js"></script> <script src="./js/masonstrap.min.js"></script>
<script src="./js/bootstrap.bundle.min.js"></script>
</html> </html>
\ No newline at end of file
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment