Add external grunt concat file

This commit is contained in:
Antoine Boulanger
2015-01-28 23:00:00 -05:00
parent 3694cfc149
commit d3aba1fe4c
18 changed files with 253 additions and 230 deletions

6
.gitignore vendored
View File

@@ -1,5 +1 @@
/boilerplate.sublime-project
/boilerplate.sublime-workspace
project-x/node_modules/
project-x/.sass-cache/
project-x/npm-debug.log
project-x/modules/boilerplate/node_modules/

View File

@@ -1,26 +1,145 @@
module.exports = function(grunt) {
'use strict';
grunt.initConfig({
pkg: grunt.file.readJSON( 'package.json' ),
// concat: Concatenate files
concat: {
global: {
src: [
'modules/boilerplate/assets/scripts/src/vendor/jquery-1.11.1.min.js'
,'modules/boilerplate/assets/scripts/src/global.js'
],
dest: 'modules/boilerplate/assets/scripts/dist/main.js',
}/*,
home: {
src: [
'modules/boilerplate/assets/scripts/src/vendor/carousel.js'
,'modules/boilerplate/assets/scripts/src/templates/home.js'
,'modules/boilerplate/assets/scripts/src/objects/video.js'
],
dest: 'modules/boilerplate/assets/scripts/dist/home.js',
}*/
pkg: grunt.file.readJSON('package.json'),
// concat: Concatenate files.
concat: require('./assets/scripts/grunt-concat'),
// sass: Compile Sass to CSS
sass: {
options: {
sourceMap: false
},
dist: {
files: {
'assets/styles/dist/main.css': 'assets/styles/src/main.scss'
}
}
},
// svgstore: Merge svgs from a folder
svgstore: {
options: {
},
default : {
files: {
'assets/images/svgs.svg': ['assets/images/svgs/*.svg'],
},
},
},
// autoprefixer: Parse CSS and add vendor prefixes to CSS rules using values from the Can I Use website
autoprefixer: {
build: {
options: {
browsers: ['last 2 versions', '> 1%', 'ie >= 8']
},
files: [
{
src : ['assets/styles/dist/*.css'],
dest : 'assets/styles/dist/',
expand : true,
flatten : true
}
]
}
},
// watch: Run tasks whenever watched files change.
watch: {
concat: {
files: ['assets/scripts/src/**/*.js'],
tasks: ['concat', 'notify:concat']
},
concatconfig: {
files: ['assets/scripts/grunt-concat.js'],
options: {
reload: true
}
},
sass: {
files: ['assets/styles/src/**/*.scss'],
tasks: ['sass', 'autoprefixer', 'notify:sass'],
options: {
spawn: false,
livereload: true
}
},
svgstore: {
files: ['assets/images/svgs/*.svg'],
tasks: ['svgstore', 'notify:svg']
}
},
// notify: Automatic Notifications when Grunt tasks fail (or succeed)
notify: {
watch: {
options: {
// title: '<%= pkg.title %>',
message: 'Keeping an eye out, Chief!'
}
},
sass: {
options: {
// title: '<%= pkg.title %>',
message: 'Sass compiled to CSS.'
}
},
concat: {
options: {
// title: '<%= pkg.title %>',
message: 'JavaScript is now concatenated'
}
},
svg: {
options: {
// title: '<%= pkg.title %>',
message: 'SVG is now concatenated'
}
}
},
// csscomb: Sort CSS properties in specific order.
csscomb: {
build: {
expand: true,
cwd: 'assets/styles/src/',
src: ['**/*.scss'],
dest: 'assets/styles/src/'
}
},
// uglify: Minify (javascript)files with UglifyJS
uglify: {
target: {
files: {
'assets/scripts/dist/': ['assets/scripts/dist/*.js']
}
}
},
// cssmin: Compress CSS files
cssmin: {
combine: {
files: {
'assets/styles/dist/': ['assets/scripts/dist/*.css']
}
}
},
// imagemin: Minify PNG and JPEG images.
imagemin: {
dynamic: {
files: [{
expand: true,
cwd: 'assets/images/',
src: ['*.{png,jpg,gif}'],
dest: 'assets/images/'
}]
}
},
// jsonlint: Validate JSON files
@@ -91,152 +210,40 @@ module.exports = function(grunt) {
'charcoal/modules/**/code/*.php',
'charcoal/modules/**/code/**/*.php'
]
},
// watch: Run tasks whenever watched files change
watch: {
css: {
files: ['modules/boilerplate/assets/styles/src/**/*.scss'],
tasks: ['sass', 'autoprefixer', 'notify:sass'],
options: {
spawn: false,
livereload: true
}
},
concat: {
files: ['modules/boilerplate/assets/scripts/src/**/*.js'],
tasks: ['concat', 'notify:concat']
},
svgstore: {
files: ['modules/boilerplate/assets/images/svgs/*.svg'],
tasks: ['svgstore', 'notify:svg']
}
},
// sass: Compile Sass to CSS.
sass: {
dist: {
files: {
'modules/boilerplate/assets/styles/dist/main.css': 'modules/boilerplate/assets/styles/src/main.scss'
}
}
},
// csscomb: Sort CSS properties in specific order.
csscomb: {
build: {
expand: true,
cwd: 'modules/boilerplate/assets/styles/src/',
src: ['**/*.scss'],
dest: 'modules/boilerplate/assets/styles/src/'
}
},
// autoprefixer: Parse CSS and add vendor prefixes to CSS rules using values from the Can I Use website
autoprefixer: {
build: {
options: {
browsers: ['last 2 versions', '> 1%', 'ie >= 8']
},
files: [
{
src : ['modules/boilerplate/assets/styles/dist/*.css'],
dest : 'modules/boilerplate/assets/styles/dist/',
expand : true,
flatten: true
}
]
}
},
// notify: Automatic Notifications when Grunt tasks fail (or succeed)
notify: {
watch: {
options: {
// title: '<%= pkg.title %>',
message: 'Keeping an eye out, Chief!'
}
},
sass: {
options: {
// title: '<%= pkg.title %>',
message: 'Sass compiled to CSS.'
}
},
concat: {
options: {
// title: '<%= pkg.title %>',
message: 'Javascript is now concatenated'
}
},
svg: {
options: {
// title: '<%= pkg.title %>',
message: 'SVG is now concatenated'
}
}
},
// svgstore: Merge svgs from a folder
svgstore: {
options: {
},
default : {
files: {
'modules/boilerplate/assets/images/svgs.svg': ['modules/boilerplate/assets/images/svgs/*.svg'],
},
},
},
// uglify: Minify (javascript)files with UglifyJS
uglify: {
my_target: {
files: {
'modules/boilerplate/assets/scripts/dist/': ['modules/boilerplate/assets/scripts/dist/*.js']
}
}
},
// cssmin: Compress CSS files
cssmin: {
combine: {
files: {
'modules/boilerplate/assets/styles/dist/': ['modules/boilerplate/assets/scripts/dist/*.css']
}
}
},
// imagemin: Minify PNG and JPEG images.
imagemin: {
dynamic: {
files: [{
expand: true,
cwd: 'modules/boilerplate/assets/images/',
src: ['*.{png,jpg,gif}'],
dest: 'modules/boilerplate/assets/images/'
}]
}
}
});
// Load plugin(s)
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-jsonlint');
grunt.loadNpmTasks("grunt-phplint");
grunt.loadNpmTasks('grunt-contrib-watch');
//grunt.loadNpmTasks('grunt-contrib-sass');
grunt.loadNpmTasks('grunt-sass');
grunt.loadNpmTasks('grunt-notify');
grunt.loadNpmTasks('grunt-autoprefixer');
// Load tasks
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-csscomb');
grunt.loadNpmTasks("grunt-markdown-pdf");
grunt.loadNpmTasks('grunt-sass');
grunt.loadNpmTasks('grunt-svgstore');
grunt.loadNpmTasks('grunt-autoprefixer');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-notify');
grunt.loadNpmTasks('grunt-csscomb');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-cssmin');
grunt.loadNpmTasks('grunt-contrib-imagemin');
grunt.loadNpmTasks('grunt-jsonlint');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks("grunt-phplint");
grunt.registerTask('default', ['notify:watch', 'watch']);
// Register tasks
grunt.registerTask('default', ['watch', 'notify:watch']);
grunt.registerTask('build', [
'concat',
'sass',
'svgstore',
'autoprefixer',
'uglify',
'cssmin',
'imagemin'
]);
grunt.registerTask('c', [
'csscomb'
]);
grunt.registerTask('wlint', [
// Javasript
'jshint',
@@ -249,19 +256,5 @@ module.exports = function(grunt) {
// Utilities
'watch'
]);
grunt.registerTask('build', [
'sass',
'autoprefixer',
'concat',
'uglify',
'cssmin',
'imagemin'
]);
grunt.registerTask('c', [
'csscomb'
]);
grunt.registerTask('svg', ['svgstore']);
grunt.registerTask('s', [
'sass'
]);
};

Binary file not shown.

View File

@@ -1 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" width="13" height="13" viewBox="0 0 13 13"><path fill="#222" d="M13 1.4l-1.5-1.4-5 5.1-5.1-5.1-1.4 1.4 5.1 5.2-5.1 5 1.5 1.4 5-5 5 5 1.4-1.4-5-5z"/></svg>

Before

Width:  |  Height:  |  Size: 194 B

View File

@@ -1 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" width="13" height="7.3" viewBox="0 0 13 7.3"><path fill="#3C3C3B" d="M6.5 7.3l3.3-3.7 3.2-3.6h-13l3.3 3.6z"/></svg>

Before

Width:  |  Height:  |  Size: 155 B

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,11 @@
module.exports = {
main: {
src: [
'assets/scripts/src/vendors/jquery-1.11.2.min.js'
,'assets/scripts/src/main.js'
],
dest: 'assets/scripts/dist/main.js',
}
}

View File

@@ -0,0 +1,3 @@
/* ==========================================================================
Main
========================================================================== */

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -1,8 +1,6 @@
/**
* Project-x / Public Site
* ==========================================================================
*
*/
/* ==========================================================================
Main
========================================================================== */
/* ==========================================================================
Imports
========================================================================== */
@@ -21,6 +19,12 @@
========================================================================== */
/* Transitions
========================================================================== */
/* ==========================================================================
Functions
========================================================================== */
/* ==========================================================================
Mixins
========================================================================== */
/*! normalize.css v3.0.1 | MIT License | git.io/normalize */
/**
* 1. Set default font family to sans-serif.
@@ -353,9 +357,6 @@ html {
font-size: 16px;
line-height: 1.4;
box-sizing: border-box;
font-size: 16px;
font-family: sans-serif;
line-height: 1.4;
color: #222222; }
::-moz-selection {
@@ -384,7 +385,12 @@ textarea {
a {
color: #1A0DAB; }
a:hover {
color: #11097c; }
color: #13097c; }
button {
outline: none;
border: none;
background-color: none; }
.container {
position: relative;
@@ -395,16 +401,18 @@ a {
========================================================================== */
.grid {
font-size: 0;
letter-spacing: normal;
position: relative;
margin-left: -20px; }
.grid--full {
margin-left: 0; }
.grid--full .grid__item, .grid--full .whole, .grid--full .half, .grid--full .third, .grid--full .two-thirds, .grid--full .quarter, .grid--full .fifth {
.grid--full > .grid__item, .grid--full > .whole, .grid--full > .half, .grid--full > .third, .grid--full > .two-thirds, .grid--full > .quarter, .grid--full > .three-quarters, .grid--full > .fifth {
margin-bottom: 0;
padding-left: 0; }
.grid__item, .whole, .half, .third, .two-thirds, .quarter, .fifth {
.grid__item, .whole, .half, .third, .two-thirds, .quarter, .three-quarters, .fifth {
font-size: 16px;
display: inline-block;
width: 100%;
margin-bottom: 20px;
@@ -417,25 +425,32 @@ a {
@media (min-width: 1024px) {
.third {
width: span(0.33333); } }
width: 33.3333333333%; } }
@media (min-width: 1024px) {
.two-thirds {
width: span(0.66667); } }
width: 66.6666666667%; } }
@media (min-width: 768px) {
.quarter {
width: 50%; } }
@media (min-width: 1024px) {
.quarter {
width: span(0.25); } }
width: 25%; } }
@media (min-width: 768px) {
.three-quarters {
width: 50%; } }
@media (min-width: 1024px) {
.three-quarters {
width: 75%; } }
@media (min-width: 768px) {
.fifth {
width: 50%; } }
@media (min-width: 1024px) {
.fifth {
width: span(0.2); } }
width: 20%; } }
/* ==========================================================================
Headings
@@ -476,13 +491,13 @@ h6, .h6, .zeta {
/* Input
========================================================================== */
.input, .select__input, .checkbox__check {
background-color: #cccccc;
display: block;
width: 100%;
color: #000000;
border: none;
border-radius: 0;
outline: none;
background-color: #CCCCCC;
-webkit-appearance: none;
-moz-appearance: none;
appearance: none; }
@@ -490,21 +505,21 @@ h6, .h6, .zeta {
/* Select
========================================================================== */
.select {
display: block;
position: relative; }
position: relative;
display: block; }
.select:after {
content: "";
position: absolute;
top: 0;
right: 0;
display: block;
width: 30px;
height: 100%;
display: block;
background-color: #ccc;
background-image: url('../../images/select-arrow.svg');
content: "";
pointer-events: none;
background-color: #CCCCCC;
background-image: url("../../images/select-arrow.svg");
background-repeat: no-repeat;
background-position: center;
pointer-events: none; }
background-position: center; }
.select__input {
padding-right: 30px; }
@@ -526,21 +541,15 @@ h6, .h6, .zeta {
width: 25px;
height: 25px; }
.checkbox__check:after {
content: "";
display: block;
background-image: url('../../images/check.svg');
background-repeat: no-repeat;
background-position: center;
visibility: hidden;
width: 25px;
height: 25px;
visibility: hidden; }
content: "";
background-image: url("../../images/check.svg");
background-repeat: no-repeat;
background-position: center; }
/* ==========================================================================
Functions
========================================================================== */
/* ==========================================================================
Mixins
========================================================================== */
/* ==========================================================================
Helpers
========================================================================== */
@@ -551,15 +560,15 @@ h6, .h6, .zeta {
.clearfix:after {
clear: both; }
.center-vertically {
.vertical-center {
height: 100%;
text-align: center; }
.center-vertically:before {
.vertical-center:before {
display: inline-block;
height: 100%;
content: "";
vertical-align: middle; }
.center-vertically > * {
.vertical-center > * {
display: inline-block;
vertical-align: middle; }

View File

@@ -1,8 +1,6 @@
/**
* Project-x / Public Site
* ==========================================================================
*
*/
/* ==========================================================================
Main
========================================================================== */
$jacket: vanilla;
@import "import";
@import "imports";

View File

@@ -17,7 +17,6 @@
"grunt-contrib-watch": "*",
"grunt-csscomb": "*",
"grunt-jsonlint": "*",
"grunt-markdown-pdf": "*",
"grunt-notify": "*",
"grunt-phplint": "*",
"grunt-sass": "*",