Skip to content

Instantly share code, notes, and snippets.

@Teino1978-Corp
Created November 7, 2015 22:10
Show Gist options
  • Select an option

  • Save Teino1978-Corp/3794aef43801d51456d6 to your computer and use it in GitHub Desktop.

Select an option

Save Teino1978-Corp/3794aef43801d51456d6 to your computer and use it in GitHub Desktop.
grunt
module.exports = function(grunt) {
/*
* install grunt global:
* $ npm install -g grunt-cli
*
* install dependencies from package.json (must run in project dir!)
* $ npm install
*/
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
concat: {
js: {
src: [
'../../htdocs/angular/app/scripts/app.js',
'../../htdocs/angular/app/scripts/controllers/controllers.js',
'../../htdocs/angular/app/scripts/filters/filters.js',
'../../htdocs/angular/app/scripts/directives/directives.js'
],
dest: '../../htdocs/angular/app/scripts/concat.js'
}
// ,
// css: {
// src: ['src/file1.css', 'src/file2.css'],
// dest: 'dest/concat.css'
// }
},
uglify: {
options: {
banner: '/*! <%= pkg.name %> <%= grunt.template.today("yyyy-mm-dd") %> */\n'
},
build: {
src: '../../htdocs/angular/app/scripts/concat.js',
dest: '../../htdocs/angular/app/scripts/concat.min.js'
}
},
cssmin: {
css:{
src: '../../htdocs/angular/app/styles/main.css',
dest: '../../htdocs/angular/app/styles/main.min.css'
}
}
// ,watch: {
// files: ['**/*','!**/node_modules/**'],
// tasks: ['concat', 'uglify', 'cssmin', 'htmlmin','ftpush']
// }
});
// Load the plugin that provides the "uglify" task.
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-cssmin');
// grunt.loadNpmTasks('grunt-contrib-watch');
// Default task(s).
grunt.registerTask('default', ['concat', 'uglify', 'cssmin']);
// grunt.registerTask('dev', ['watch']);
};
{
"name": "more-packages",
"description": "more packages for package.json",
"version": "0.1.0",
"author": "jsc",
"devDependencies": {
"grunt-contrib-jshint": "~0.6.3",
"grunt-contrib-nodeunit": "~0.2.0",
"grunt-contrib-watch": "0.5.x",
"grunt-contrib-htmlmin": "~0.2.0",
"grunt-contrib-copy": "0.5.x",
}
{
"name": "my-project-name",
"description": "An example of how to set up Grunt for web development.",
"version": "0.1.0",
"author": "jsc",
"devDependencies": {
"grunt": "~0.4.2",
"grunt-contrib-concat": "~0.4.0",
"grunt-contrib-uglify": "~0.2.2",
"grunt-contrib-cssmin": "~0.9.0"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment