Commit a03cd749 authored by Kjetil Thuen's avatar Kjetil Thuen

Create .min.js file. Run bower from Grunt

parent 93ad9427
.*.swp
*_template.js
tags
build
dist
lib
node_modules
bower_components
......@@ -2,23 +2,36 @@ module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
bower: {
install: {
//just run 'grunt bower:install' and you'll see files from your Bower packages in lib directory
}
},
concat: {
options: {
//targetDir: './lib'
// define a string to put between each file in the concatenated output
separator: ';'
},
install: {
//Just install the damn thing...
dist: {
// the files to concatenate
src: ['src/**/*.js'],
// the location of the resulting JS file
dest: 'dist/<%= pkg.name %>.js'
}
},
copy: {
main: {
files: [
{expand: true, cwd: 'src/', src: '*.js', dest: 'build/listentryinfo/'}
]
uglify: {
options: {
// the banner is inserted at the top of the output
banner: '/*! <%= pkg.name %> <%= grunt.template.today("dd-mm-yyyy") %> */\n'
},
dist: {
files: {
'dist/<%= pkg.name %>.min.js': ['<%= concat.dist.dest %>']
}
}
},
jshint: {
// define the files to lint
files: ['src/*.js'],
files: ['gruntfile.js', 'src/*.js'],
// configure JSHint (documented at http://www.jshint.com/docs/)
options: {
// more options here if you want to override JSHint defaults
......@@ -35,14 +48,14 @@ module.exports = function(grunt) {
});
// Load libs
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-bower-task');
grunt.loadNpmTasks('grunt-contrib-clean');
// Tasks
grunt.registerTask('default', ['bower', 'jshint', 'copy']);
grunt.registerTask('build', ['copy']);
grunt.registerTask('test', ['jshint']);
grunt.registerTask('default', ['bower', 'jshint', 'concat', 'uglify']);
grunt.registerTask('install', ['bower']);
//grunt.registerTask('clean', ['clean']);
grunt.registerTask('clean', ['clean']);
};
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