Last active
November 12, 2017 13:55
-
-
Save fedek6/20a33771192b11010fcd0ea95bd30333 to your computer and use it in GitHub Desktop.
Grunt file designed for e-mail HTML creation.
This file contains hidden or 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
module.exports = function (grunt) { | |
grunt.initConfig({ | |
/** | |
* Prepare banner. | |
* This will be used as header for generated files. | |
*/ | |
pkg: grunt.file.readJSON('package.json'), | |
banner: '/*! <%= pkg.name %> - v<%= pkg.version %> ' + '<%= grunt.template.today("yyyy-mm-dd h:MM:ss") %>' + '*/' + "\n", | |
/* Minify html */ | |
minifyHtml: { | |
options: { | |
cdata: true, | |
conditionals: true | |
}, | |
dist: { | |
files: { | |
'pub/index.html': 'pub/index.html' | |
} | |
} | |
}, | |
/* Include css file inside html */ | |
inline: { | |
dist: { | |
src: 'src/index.html', | |
dest: 'pub/index.html' | |
} | |
}, | |
/* Sass */ | |
sass: { | |
dist: { | |
options: { | |
style: 'compressed', | |
sourcemap: 'none' | |
}, | |
files: [{ | |
expand: true, | |
cwd: 'src/scss', | |
src: ['**/*.scss'], | |
dest: 'src/css', | |
ext: '.css' | |
}] | |
} | |
} | |
}); | |
grunt.loadNpmTasks('grunt-minify-html'); | |
grunt.loadNpmTasks('grunt-inline'); | |
grunt.loadNpmTasks('grunt-contrib-sass'); | |
grunt.registerTask('default', ['sass', 'inline', 'minifyHtml']); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment