Skip to content

Instantly share code, notes, and snippets.

@fedek6
Last active November 12, 2017 13:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fedek6/20a33771192b11010fcd0ea95bd30333 to your computer and use it in GitHub Desktop.
Save fedek6/20a33771192b11010fcd0ea95bd30333 to your computer and use it in GitHub Desktop.
Grunt file designed for e-mail HTML creation.
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