forked from joejoinerr/tumblr-boilerplate
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f8b97e8
commit 6bcbd5c
Showing
3 changed files
with
113 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
# Folders | ||
node_modules/ | ||
Build/ | ||
dist/ | ||
tumblr-boilerplate.wiki/ | ||
|
||
# Files | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,110 @@ | ||
module.exports = function(grunt) { | ||
// Create configuration | ||
grunt.initConfig({ | ||
pkg: grunt.file.readJSON('package.json'), | ||
cssmin: { | ||
minify: { | ||
expand: true, | ||
cwd: 'css/', | ||
src: '*.css', | ||
dest: '.tmp/', | ||
ext: '.min.css' | ||
} | ||
|
||
// Create configuration | ||
grunt.initConfig({ | ||
|
||
// Read packages | ||
pkg: grunt.file.readJSON("package.json"), | ||
|
||
// LibSass preprocessing | ||
sass: { | ||
options: { | ||
includePaths: ["bower_components"], | ||
precision: 5, | ||
}, | ||
dev: { | ||
files: [{ | ||
expand: true, | ||
cwd: "sass", | ||
src: ["**/*.scss"], | ||
dest: "css", | ||
ext: ".css" | ||
}], | ||
options: { | ||
outputStyle: "expanded", | ||
sourceMap: true | ||
} | ||
}, | ||
dist: { | ||
files: [{ | ||
expand: true, | ||
cwd: "sass", | ||
src: ["**/*.scss"], | ||
dest: "css", | ||
ext: ".min.css" | ||
}], | ||
options: { | ||
outputStyle: "compressed", | ||
} | ||
} | ||
}, | ||
|
||
// Send CSS to HTML file | ||
htmlbuild: { | ||
dist: { | ||
src: "index.html", | ||
dest: "dist/", | ||
}, | ||
options: { | ||
styles: { | ||
main: "css/*.min.css" | ||
} | ||
} | ||
}, | ||
|
||
// Clean | ||
|
||
// CSS linting | ||
csslint: { | ||
lint: { | ||
options: { | ||
"import": 2, | ||
"box-model": false, | ||
"box-sizing": false, | ||
"unique-headings": false, | ||
"universal-selector": false | ||
}, | ||
htmlbuild: { | ||
dist: { | ||
src: 'index.html', | ||
dest: 'Build/', | ||
}, | ||
options: { | ||
styles: { | ||
main: '.tmp/*.min.css' | ||
} | ||
} | ||
src: ["css/main.css"] | ||
} | ||
}, | ||
|
||
// Start server | ||
connect: { | ||
server: { | ||
options: { | ||
livereload: true | ||
} | ||
} | ||
}, | ||
|
||
// Watch and reload compiled stylesheets | ||
watch: { | ||
sass: { | ||
files: "sass/**/*.scss", | ||
tasks: ["sass:dev"], | ||
}, | ||
livereload: { | ||
options: { | ||
livereload: true, | ||
}, | ||
clean: [ '.tmp/' ] | ||
}); | ||
files: ["*.html", "css/**/*.css"] | ||
} | ||
} | ||
|
||
}); | ||
|
||
// Load plugins | ||
grunt.loadNpmTasks("grunt-sass"); | ||
grunt.loadNpmTasks("grunt-html-build"); | ||
grunt.loadNpmTasks("grunt-contrib-csslint"); | ||
grunt.loadNpmTasks("grunt-contrib-connect"); | ||
grunt.loadNpmTasks("grunt-contrib-watch"); | ||
|
||
// Run tasks | ||
grunt.registerTask("default", ["sass:dev", "connect", "watch"]); | ||
grunt.registerTask("build", ["sass:dev"]); | ||
grunt.registerTask("lint", ["sass:dev", "csslint"]); | ||
grunt.registerTask("dist", ["sass:dist", "htmlbuild"]); | ||
|
||
// Register the plugins | ||
grunt.loadNpmTasks('grunt-contrib-cssmin'); | ||
grunt.loadNpmTasks('grunt-html-build'); | ||
grunt.loadNpmTasks('grunt-contrib-clean'); | ||
}; | ||
|
||
// Run the task | ||
grunt.registerTask('default', ['cssmin', 'htmlbuild', 'clean']); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters