Skip to content

Commit

Permalink
Reconfigured Grunt for better minification; added minified files to i…
Browse files Browse the repository at this point in the history
…ndex.html
  • Loading branch information
SvSven committed Feb 24, 2016
1 parent 2295b6e commit 0f366b9
Show file tree
Hide file tree
Showing 12 changed files with 331 additions and 29 deletions.
49 changes: 33 additions & 16 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,35 +3,51 @@ module.exports = function(grunt) {
// 1. All configuration goes here
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
// Minify scripts
// Compile & minify SASS
sass: {
dist: {
options: {
style: 'expanded'
},
files: {
'css/style.css': 'scss/style.scss',
}
}
},
// Minify CSS
cssmin: {
options: {
sourceMap: true
},
target: {
files: [{
expand: true,
cwd: 'css',
src: ['*.css', '!*.min.css'],
dest: 'css',
ext: '.min.css'
}]
}
},
// Uglify scripts
uglify: {
build: {
options: {
sourceMap: true
},
files: {
'js/core.min.js': ['js/core.js']
'js/core.min.js': ['js/core.js'],
'js/fittext.min.js': ['js/fittext.js']
}
}
},
// Compile & minify SASS
sass: {
dist: {
options: {
style: 'compressed'
},
files: {
'css/style.min.css': 'scss/style.scss',
}
}
},
// Watch for changes and run tasks on change
watch: {
options: {
livereload: true
},
scripts: {
files: ['js/*.js'],
files: ['js/*.js', 'css/*.css'],
tasks: ['uglify'],
options: {
spawn: false
Expand All @@ -49,11 +65,12 @@ module.exports = function(grunt) {
});

// 3. Where we tell Grunt we plan to use this plug-in.
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-sass');
grunt.loadNpmTasks('grunt-contrib-cssmin');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-watch');

// 4. Where we tell Grunt what to do when we type "grunt" into the terminal.
grunt.registerTask('default', ['uglify', 'sass', 'watch']);
grunt.registerTask('default', ['sass', 'cssmin', 'uglify', 'watch']);

};
2 changes: 2 additions & 0 deletions css/normalize.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions css/normalize.min.css.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

280 changes: 279 additions & 1 deletion css/style.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions css/style.css.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 0f366b9

Please sign in to comment.