dshafik / .bowerrc secret
Last active

Embed URL

HTTPS clone URL

SSH clone URL

You can clone with HTTPS or SSH.

Download Gist

Example Gulp/Bower Configuration

View .bowerrc
1 2 3
{
"directory": "public/bower_components"
}
View .bowerrc
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
{
"name": "gulp-bower-example",
"version": "0.0.1",
"authors": [
"Davey Shafik <davey@engineyard.comm>"
],
"main": "public/index.php",
"license": "Apache 2.0",
"private": true,
"ignore": [
"**/.*",
"node_modules",
"bower_components",
"test",
"tests"
],
"dependencies": {
"jquery": "~2.1.1",
"bootstrap": "~3.1.1"
}
}
View .bowerrc
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68
var gulp = require('gulp');
$ = require('gulp-load-plugins')(); // Note the extra parens
 
gulp.task('default', ['minify', 'fix-template', 'fix-paths', 'add-headers']);
 
gulp.task('minify', ['clean'], function() {
return gulp.src('src/templates/layout.src.tpl')
.pipe($.usemin({
assetsDir: 'public',
css: [$.minifyCss(), 'concat'],
js: [$.uglify(), 'concat']
}))
.pipe(gulp.dest('public'));
});
 
gulp.task('fix-template', ['minify'], function() {
return gulp.src('public/layout.src.tpl')
.pipe($.rimraf())
.pipe($.rename("layout.tpl"))
.pipe(gulp.dest('src/templates'));
});
 
gulp.task('fix-paths', ['minify'], function() {
gulp.src('public/css/site.css')
.pipe($.replace('../', '../bower_components/bootstrap/dist/'))
.pipe(gulp.dest('public/css'));
});
 
gulp.task('add-headers', ['fix-template'], function() {
gulp.src('src/templates/layout.tpl')
.pipe($.header("<!-- This file is generated — do not edit by hand! -->\n"))
.pipe(gulp.dest('src/templates'));
 
gulp.src('public/js/site.js')
.pipe($.header("/* This file is generated — do not edit by hand! */\n"))
.pipe(gulp.dest('public/js'));
 
gulp.src('public/css/site.css')
.pipe($.header("/* This file is generated — do not edit by hand! */\n"))
.pipe(gulp.dest('public/css'));
});
 
gulp.task('clean', function() {
var generated = ['public/js/site.js', 'public/css/site.css', 'src/templates/layout.tpl'];
return gulp.src(generated)
.pipe($.rimraf());
});
 
gulp.task('dev', ['clean'], function() {
gulp.src('src/templates/layout.src.tpl')
.pipe($.rename('layout.tpl'))
.pipe($.header("<!-- This file is generated — do not edit by hand! -->\n"))
.pipe(gulp.dest('src/templates'));
});
 
gulp.task('watch', ['default'], function() {
var watchFiles = [
'src/templates/layout.src.tpl',
'public/bower_components/*/dist/js/*.js',
'!public/bower_components/*/dist/js/*.min.js',
'public/bower_components/*/dist/*.js',
'public/bower_components/*/dist/css/*.css',
'!public/bower_components/*/dist/css/*.min.css',
'public/bower_components/*/dist/font/*'
];
 
gulp.watch(watchFiles, ['default']);
});
View .bowerrc
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
{
"name": "gulp-bower-example",
"version": "0.0.1",
"description": "",
"main": "public/index.php",
"dependencies": {
"bower": "~1.3.5"
},
"devDependencies": {
"gulp": "^3.8.0",
"gulp-minify-css": "^0.3.4",
"gulp-usemin": "^0.3.5",
"gulp-uglify": "^0.3.0",
"gulp-rename": "^1.2.0",
"gulp-rimraf": "^0.1.0",
"gulp-replace": "^0.3.0",
"gulp-header": "^1.0.2"
},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "Davey Shafik <davey@engineyard.com>",
"license": "Apache 2.0"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.