Skip to content

Commit

Permalink
added config variables to gruntfile
Browse files Browse the repository at this point in the history
  • Loading branch information
newaeonweb committed Dec 8, 2014
1 parent e051718 commit 643835b
Show file tree
Hide file tree
Showing 6 changed files with 47 additions and 16 deletions.
38 changes: 27 additions & 11 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,41 @@
module.exports = function (grunt) {

'use strict';

// Setup folders name, so if you wnat use a different folder structure, just update this variables
var config = {
dirName: 'assets',
srcName: 'src'
}

// Unified Watch Object asign variables for easy editing
var watchFiles = {
clientJS: ['assets/js/*.js', 'assets/js/vendor/*.js'],
clientSrc: ['src/scripts/*.js'],
clientCSS: ['assets/css/**/*.css'],
clientPreprocessor: ['src/preprocessor/*.less', 'src/preprocessor/*.scss'],
clientHTML: ['assets/*.html'],
mochaTests: ['assets/test/unit/*.js'],
concatBase: ['src/scripts/*js', 'src/vendor/*js' ]
clientJS: [config.dirName + '/js/*.js', config.dirName + '/js/vendor/*.js'],
clientSrc: [config.srcName + '/scripts/*.js'],
clientCSS: [config.dirName + '/css/**/*.css'],
clientPreprocessor: [config.srcName + '/preprocessor/*.less', config.srcName + '/preprocessor/*.scss'],
clientHTML: ['/*.html'],
mochaTests: [config.dirName + '/test/unit/*.js'],
concatBase: [config.srcName + '/scripts/*js', 'src/vendor/*js' ]
};
// Define the configuration for all the tasks
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
banner: '/*!\n' +
'* <%= pkg.name %> - v<%= pkg.version %> - MIT LICENSE <%= grunt.template.today("dd") %> <%= grunt.template.today("mm") %> <%= grunt.template.today("yyyy") %>. \n' +
'* <%= pkg.name %> - v<%= pkg.version %> - MIT LICENSE <%= grunt.template.today("yyyy-mm-dd") %>. \n' +
'* @author <%= pkg.author %>\n' +
'*/\n',
// Project settings

clean: {
build: {
src: [ config.dirName + '/css/*.css', config.dirName + '/js/*.js']
},
// use this task to run before start coding
//reset: {
// src: [config.srcName + 'preprocessor', config.srcName + 'scripts', 'lib']
//}
},
// Watches files for changes and runs tasks based on the changed files
watch: {
clientJS: {
Expand Down Expand Up @@ -88,7 +104,7 @@ module.exports = function (grunt) {
},
base: {
src: ['<%= concat.base.dest %>'],
dest: 'assets/js/<%= pkg.name %>-scripts.min.js'
dest: config.dirName + '/js/<%= pkg.name %>-scripts.min.js'
}
},
recess: {
Expand All @@ -100,8 +116,8 @@ module.exports = function (grunt) {
options: {
compress: false
},
src: ['src/preprocessor/*.less'],
dest: 'assets/css/<%= pkg.name %>-style.css'
src: [config.srcName + '/preprocessor/*.less'],
dest: config.dirName + '/css/<%= pkg.name %>-style.css'
}
},
sass: {
Expand Down
18 changes: 15 additions & 3 deletions assets/css/frontendboilerplate-style.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
body {
font: 100% Helvetica, sans-serif;
color: #333; }
/*!
* frontendboilerplate - v0.1.0 - MIT LICENSE 2014-12-08.
* @author Fernando Monteiro
*/
/* Sample using Less with CSS comments*/

.box {
color: #fe33ac;
border-color: #fdcdea;
}

.box div {
-webkit-box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
}
2 changes: 1 addition & 1 deletion assets/js/frontendboilerplate-scripts.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* frontendboilerplate - v0.1.0 - MIT LICENSE 08 12 2014.
* frontendboilerplate - v0.1.0 - MIT LICENSE 2014-12-08.
* @author Fernando Monteiro
*/
/**
Expand Down
2 changes: 1 addition & 1 deletion assets/js/frontendboilerplate-scripts.min.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* frontendboilerplate - v0.1.0 - MIT LICENSE 08 12 2014.
* frontendboilerplate - v0.1.0 - MIT LICENSE 2014-12-08.
* @author Fernando Monteiro
*/
function sampleA(){"use strict";window.console.log("Sample A")}function sampleB(){"use strict";window.console.log("Sample B")}sampleA(),sampleB();var Apple=function(a){"use strict";return a=a||{},this.name=a.name||"Fuji",this.sound=a.sound||"crunch",this};
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
"grunt": "^0.4.5",
"grunt-bower-task": "^0.4.0",
"grunt-concurrent": "^1.0.0",
"grunt-contrib-clean": "^0.6.0",
"grunt-contrib-concat": "^0.5.0",
"grunt-contrib-connect": "^0.9.0",
"grunt-contrib-csslint": "^0.3.1",
Expand Down
2 changes: 2 additions & 0 deletions src/preprocessor/sample.less
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
// Sample Less
@base: #f938ab;

/* Sample using Less with CSS comments*/

.box-shadow(@style, @c) when (iscolor(@c)) {
-webkit-box-shadow: @style @c;
box-shadow: @style @c;
Expand Down

0 comments on commit 643835b

Please sign in to comment.