ACC SHELL
module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
concat: {
'js/<%= pkg.name %>.js': [
'bower_components/jquery/dist/jquery.min.js',
'bower_components/bootstrap/dist/js/bootstrap.min.js',
'bower_components/modernizr/modernizr.js',
'bower_components/slick-carousel/slick/slick.js',
'bower_components/magnific-popup/dist/jquery.magnific-popup.js',
'src/js/*.js',
]
},
less: {
'css/<%= pkg.name %>.css': ['src/less/style.less']
},
autoprefixer: {
options: {
browsers: ['> 5%', 'last 10 versions', 'Firefox ESR', 'Opera 12.1', 'ie 8', 'ie 9']
},
single_file: {
src: 'css/<%= pkg.name %>.css',
dest: 'css/<%= pkg.name %>.css'
}
},
watch: {
options: {
livereload: true,
},
scripts: {
files: [
'src/js/*.js'
],
tasks: ['concat']
},
css: {
files: 'src/less/*.less',
tasks: ['less']
},
styles: {
files: ['css/<%= pkg.name %>.css'],
tasks: ['autoprefixer']
}
}
});
// Load the plugin that provides the "uglify" task.
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-less');
grunt.loadNpmTasks('grunt-autoprefixer');
// Default task(s).
grunt.registerTask('default', ['concat','less', 'autoprefixer']);
// start watch in CLI
grunt.event.on ('watch', function(action, filepath, target) {
grunt.log.writeln(target + ': ' + filepath + ' has ' + action);
});
};
ACC SHELL 2018