Skip to content

Instantly share code, notes, and snippets.

@itsliamjones
Forked from curiouslychase/.bowerrc
Created July 3, 2016 16:14
Show Gist options
  • Save itsliamjones/8262f2c25af920f3f5842d4233bdb6d9 to your computer and use it in GitHub Desktop.
Save itsliamjones/8262f2c25af920f3f5842d4233bdb6d9 to your computer and use it in GitHub Desktop.
Gist for example bower project blog post.
{
"directory": "src/_lib",
"json": "bower.json"
}
src
dist
node_modules
{
"name": "bower_example",
"version": "0.0.0",
"authors": [
"Chase Adams <[email protected]>"
],
"description": "An example of how to use bower",
"license": "MIT",
"homepage": "http://www.realchaseadams.com",
"private": true,
"ignore": [
"**/.*",
"node_modules",
"bower_components",
"src/_lib",
"test",
"tests"
],
"dependencies": {
"underscore": "~1.5.2",
"jquery": "~2.0.3",
"font-awesome": "~4.0.3",
"requirejs": "~2.1.9"
}
}
var pkgjson = require('./package.json');
var config = {
pkg: pkgjson,
app: 'src',
dist: 'dist'
}
module.exports = function (grunt) {
// Configuration
grunt.initConfig({
config: config,
pkg: config.pkg,
bower: grunt.file.readJSON('./.bowerrc'),
copy: {
dist: {
files: [{
expand: true,
cwd: '<%= config.app %>/_lib/font-awesome',
src: 'css/font-awesome.min.css',
dest: '<%= config.dist %>'
},
{
expand: true,
cwd: '<%= config.app %>/_lib/font-awesome',
src: 'fonts/*',
dest: '<%= config.dist %>'
}]
}
},
uglify: {
options: {
banner: '/*! <%= pkg.name %> lib - v<%= pkg.version %> -' +
'<%= grunt.template.today("yyyy-mm-dd") %> */'
},
dist: {
files: {
'<%= config.dist %>/js/lib.min.js': [
'<%= bower.directory %>/jquery/jquery.js',
'<%= bower.directory %>/underscore/underscore.js',
'<%= bower.directory %>/requirejs/require.js',
]
}
}
}
});
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.registerTask('default', [
'copy',
'uglify'
]);
};
{
"name": "bower_example",
"version": "0.0.0",
"description": "An example of a bower project",
"main": "Gruntfile.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "https://gist.github.com/7369801.git"
},
"author": "Chase Adams",
"license": "BSD",
"bugs": {
"url": "https://gist.github.com/7369801"
},
"devDependencies": {
"grunt": "~0.4.1",
"grunt-contrib-copy": "~0.4.1",
"grunt-contrib-uglify": "~0.2.5"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment