Skip to content

Instantly share code, notes, and snippets.

@roelvan
Created July 22, 2013 21:05
Show Gist options
  • Save roelvan/6057671 to your computer and use it in GitHub Desktop.
Save roelvan/6057671 to your computer and use it in GitHub Desktop.
missing js property
// The wrapper function
module.exports = function(grunt) {
var SRC_CSS = 'app/css/';
var SRC_CSS_ADMIN = 'app/css/admin/';
var SRC_CSS_LANDING = 'app/css/landing/';
var SRC_JS = 'app/js/';
var SRC_JS_ADMIN = 'app/js/admin/';
var SRC_JS_LANDING = 'app/js/landing/';
var BUILD_CSS = 'web/css/';
var BUILD_JS = 'web/js/';
// Project and task configuration
grunt.initConfig({
concat: {
options: {
separator: "\n\n"
},
jsAdmin: {
src: [
//Jquery
SRC_JS_ADMIN + 'components/jquery/jquery.js',
//Bootstrap
SRC_JS_ADMIN + 'components/bootstrap/js/bootstrap-affix.js',
SRC_JS_ADMIN + 'components/bootstrap/js/bootstrap-alert.js',
SRC_JS_ADMIN + 'components/bootstrap/js/bootstrap-modal.js',
SRC_JS_ADMIN + 'components/bootstrap/js/bootstrap-button.js',
SRC_JS_ADMIN + 'components/bootstrap/js/bootstrap-collapse.js',
SRC_JS_ADMIN + 'components/bootstrap/js/bootstrap-dropdown.js',
SRC_JS_ADMIN + 'components/bootstrap/js/bootstrap-typeahead.js',
SRC_JS_ADMIN + 'components/bootstrap/js/bootstrap-tooltip.js',
SRC_JS_ADMIN + 'components/bootstrap/js/bootstrap-popover.js',
SRC_JS_ADMIN + 'components/bootstrap/js/bootstrap-transition.js',
//Select2
//SRC_JS_ADMIN + 'components/select2/select2.js',
//App
SRC_JS_ADMIN + 'app.js'
],
dest: BUILD_JS + 'main.js'
},
jsLanding: {
src: [
//Jquery
SRC_JS_LANDING + 'jquery.js',
SRC_JS_LANDING + 'gMap.js',
SRC_JS_LANDING + 'page.js',
//App
SRC_JS_LANDING + 'app.js'
],
dest: BUILD_JS + 'landing.js'
},
cssAdmin: {
src: [
//Bootstrap
SRC_CSS_ADMIN + 'bootstrap/bootstrap.css',
SRC_CSS_ADMIN + 'bootstrap/bootstrap-responsive.css',
SRC_CSS_ADMIN + 'bootstrap/bootstrap-overrides.css',
//Vendors
SRC_CSS_ADMIN + 'lib/*.css',
//App
SRC_CSS_ADMIN + '*.css',
SRC_CSS_ADMIN + 'compiled/*.css'
],
dest: BUILD_CSS + 'main.css'
},
cssLanding: {
src: [
//Bootstrap
SRC_CSS_LANDING + 'bootstrap/bootstrap.css',
SRC_CSS_LANDING + 'bootstrap/bootstrap-responsive.css',
SRC_CSS_LANDING + 'landing.css'
],
dest: BUILD_CSS + 'landing.css'
}
},
"cssmin": {
cssAdmin:{
src: BUILD_CSS + 'main.css',
dest: BUILD_CSS + 'main.min.css'
},
cssLanding:{
src: BUILD_CSS + 'landing.css',
dest: BUILD_CSS + 'landing.min.css'
}
},
"closure-compiler": {
admin: {
closurePath: 'app/lib/closure-compiler',
js: BUILD_JS + 'main.js',
jsOutputFile: BUILD_JS + 'main.min.js',
maxBuffer: 500,
options: {
compilation_level: 'SIMPLE_OPTIMIZATIONS',
language_in: 'ECMASCRIPT5_STRICT'
}
},
landing: {
closurePath: 'app/lib/closure-compiler',
js: BUILD_JS + 'landing.js',
jsOutputFile: BUILD_JS + 'landing.min.js',
maxBuffer: 500,
options: {
compilation_level: 'SIMPLE_OPTIMIZATIONS',
language_in: 'ECMASCRIPT5_STRICT'
}
}
},
watch: {
styles: {
files: [SRC_CSS + '**/*.css'],
tasks: ['concat'],
options: {
nospawn: true
}
},
scripts: {
files: [SRC_JS + '**/*.js'],
tasks: ['concat'],
options: {
nospawn: true
}
}
}
});
// Load plugins
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-closure-compiler');
grunt.loadNpmTasks('grunt-css');
// Define tasks
grunt.registerTask('default', ['watch']);
grunt.registerTask('build', ['closure-compiler', 'cssmin']);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment