Skip to content

Instantly share code, notes, and snippets.

@wescleymatos
Created May 31, 2017 02:44
Show Gist options
  • Select an option

  • Save wescleymatos/c8f85f38bf702ace3f4e707a8bcd20a0 to your computer and use it in GitHub Desktop.

Select an option

Save wescleymatos/c8f85f38bf702ace3f4e707a8bcd20a0 to your computer and use it in GitHub Desktop.
Configuração do arquivo do grunt
module.exports = function(grunt) {
grunt.initConfig({
clean: {
temp: [
'public/js/app.js',
'public/js/libs.js'
],
all: [
'public/js/*.js'
]
},
jshint: {
app: {
src: [
'public/js/app/**/*.js'
]
}
},
concat: {
app: {
src: [
'public/js/app/**/*.js'
],
dest: 'public/js/app.js'
},
libs: {
src: [
'bower_components/jquery/dist/jquery.min.js',
'bower_components/materialize/dist/js/materialize.min.js'
],
dest: 'public/js/libs.js'
}
},
uglify: {
dist: {
src: [
'public/js/libs.js',
'public/js/app.js'
],
dest: 'dist/js/app.min.js'
}
},
cssmin: {
all: {
src: [
'bower_components/materialize/dist/css/materialize.min.css',
'public/css/app/login.css'
],
dest: 'public/css/style.min.css'
}
},
copy: {
all: {
src: 'index.html',
dest: 'dist/index.html'
}
},
processhtml: {
dist: {
files: {
'dist/index.html': ['dist/index.html']
}
}
},
htmlmin: {
dist: {
options: {
removeComments: true,
collapseWhitespace: true
},
files: {
'dist/index.html': 'dist/index.html'
}
}
}
});
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-cssmin');
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-processhtml');
grunt.loadNpmTasks('grunt-contrib-htmlmin');
grunt.registerTask('dev', ['jshint:app', 'concat:libs', 'concat:app', 'cssmin']);
grunt.registerTask('default', ['jshint', 'clean:all', 'concat:scripts', 'concat:libs', 'uglify', 'cssmin', 'clean:temp', 'copy:all', 'processhtml', 'htmlmin']);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment