Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //package.json
- {
- "name": "xyz",
- "version": "0.1.0",
- "devDependencies": {
- "grunt": "1.0.0",
- "grunt-contrib-jshint": "latest",
- "jshint-stylish": "latest",
- "grunt-contrib-uglify": "latest",
- "grunt-contrib-sass": "latest",
- "grunt-contrib-cssmin": "latest",
- "grunt-contrib-watch": "latest"
- }
- }
- //gruntfile.js
- module.exports = function (grunt) {
- grunt.initConfig({
- pkg: grunt.file.readJSON('package.json'),
- jshint: {
- options: {
- reporter: require('jshint-stylish')
- },
- build: ['Gruntfile.js', 'src/**/*.js']
- },
- uglify: {
- options: {
- banner: '/*\n <%= pkg.name %> <%= grunt.template.today("yyyy-mm-dd") %> \n*/\n'
- },
- build: {
- files: {
- 'dist/js/script.min.js': 'src/js/script.js'
- }
- }
- },
- sass: {
- build: {
- files: {
- 'src/css/style.css': 'src/css/style.scss'
- }
- }
- },
- cssmin: {
- options: {
- banner: '/*\n <%= pkg.name %> <%= grunt.template.today("yyyy-mm-dd") %> \n*/\n'
- },
- build: {
- files: {
- 'dist/css/style.min.css': 'src/css/style.css'
- }
- }
- },
- watch: {
- css: {
- files: 'src/*.scss',
- tasks: ['sass', 'cssmin']
- },
- scripts: {
- files: 'src/**/*.js',
- tasks: ['jshint', 'uglify']
- }
- }
- });
- grunt.loadNpmTasks('grunt-contrib-jshint');
- grunt.loadNpmTasks('grunt-contrib-uglify');
- grunt.loadNpmTasks('grunt-contrib-sass');
- grunt.loadNpmTasks('grunt-contrib-cssmin');
- grunt.loadNpmTasks('grunt-contrib-watch');
- grunt.registerTask('default', ['jshint', 'uglify', 'cssmin', 'sass']);
- };
Add Comment
Please, Sign In to add comment