Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build: Fetch images from libraries #38

Merged
merged 1 commit into from
Jul 21, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "mnoe-frontend-admin",
"version": "1.0.0",
"version": "2.0",
"dependencies": {
"angular": "~1.6.2",
"angular-animate": "~1.6.2",
Expand Down
15 changes: 13 additions & 2 deletions gulp_tasks/misc.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,35 @@ const path = require('path');

const gulp = require('gulp');
const del = require('del');
const mainBowerFiles = require('gulp-main-bower-files');
const filter = require('gulp-filter');
const flatten = require('gulp-flatten');

const conf = require('../conf/gulp.conf');

gulp.task('clean', clean);
gulp.task('fonts', fonts);
gulp.task('images', images);
gulp.task('other', other);

function clean() {
return del([conf.paths.dist, conf.paths.tmp]);
}

function fonts(){
function fonts() {
return gulp.src([
'bower_components/font-awesome/fonts/*',
'bower_components/bootstrap/fonts/*'
])
.pipe(gulp.dest(path.join(conf.path.dist(), '/fonts/')));
.pipe(gulp.dest(conf.path.dist('/fonts/')));
}

function images() {
return gulp.src('./bower.json')
.pipe(mainBowerFiles())
.pipe(filter('**/*.{png,jpg,jpeg,gif}'))
.pipe(flatten())
.pipe(gulp.dest(conf.path.dist('/images/')));
}

function other() {
Expand Down
2 changes: 1 addition & 1 deletion gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const hub = new HubRegistry([conf.path.tasks('*.js')]);
gulp.registry(hub);

gulp.task('inject', gulp.series(gulp.parallel('styles', 'scripts'), 'inject'));
gulp.task('build', gulp.series('partials', gulp.parallel('inject', 'fonts', 'other'), 'build'));
gulp.task('build', gulp.series('partials', gulp.parallel('inject', 'fonts', 'images', 'other'), 'build'));
gulp.task('test', gulp.series('scripts', 'karma:single-run'));
gulp.task('test:auto', gulp.series('watch', 'karma:auto-run'));
gulp.task('serve', gulp.series('inject', 'watch', 'browsersync'));
Expand Down
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,13 @@
"gulp-cssnano": "^2.1.0",
"gulp-eslint": "^3.0.1",
"gulp-filter": "^5.0.0",
"gulp-flatten": "^0.3.1",
"gulp-htmlmin": "^3.0.0",
"gulp-hub": "frankwallis/gulp-hub#registry-init",
"gulp-inject": "^4.2.0",
"gulp-insert": "^0.5.0",
"gulp-less": "^3.0.5",
"gulp-main-bower-files": "^1.6.2",
"gulp-ng-annotate": "^2.0.0",
"gulp-postcss": "^6.0.1",
"gulp-replace": "^0.5.4",
Expand Down