npm install
bower install
grunt
-
-
Save mchelen/38b753fc9e3f6f4766ff to your computer and use it in GitHub Desktop.
bower + grunt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"directory": "lib", | |
"json": "bower.json" | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
src | |
dist | |
node_modules | |
lib | |
*~ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"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", | |
"lib", | |
"test", | |
"tests" | |
], | |
"dependencies": { | |
"underscore": "~1.5.2", | |
"jquery": "~2.0.3", | |
"font-awesome": "~4.0.3", | |
"requirejs": "~2.1.9" | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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' | |
]); | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"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