Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue when running grunt build #57

Open
angra8410 opened this issue Jul 19, 2020 · 1 comment
Open

Issue when running grunt build #57

angra8410 opened this issue Jul 19, 2020 · 1 comment

Comments

@angra8410
Copy link

Good day,
This is my first help cry, cause I am stuck trying to run the Grunt build for my project, this is the error I have:
jit-grunt: Plugin for the "UseminPrepare" task not found.
and this is my Gruntfile:
const { registerTask } = require("grunt");

module.exports =function (grunt){
require('time-grunt')(grunt);
require('jit-grunt')(grunt,{
useminprepare: 'grunt-usemin'
});
grunt.initConfig({
sass: {
dist: {
files: [{
expand: true,
cwd: 'css',
src: ['*.scss'],
dest: 'css',
ext: '.css'
}]
}
},

    watch: {
        files: ['css/*.scss'],
        tasks: ['css']
    },
    
    browserSync: {
        dev: {
            bsFiles: { //browser files
                src: [
                    'css/*.css',
                    '*.html',
                    'js/*.js',
                ]
                },
        options: {
            watchTask: true,
            server: {
                baseDir: './' //Directorio base para nuestro servidor
                }
            }
        }
    },

    imagemin: {
        dynamic: {
            files: [{
                expand: true,
                cwd: './',
                src: 'images/*.{png,gif,jpg,jpeg}',
                dest: 'dist/'
            }]
        }
    },

    copy: {
        html: {
            files: [{
                expand: true,
                cwd: './',
                src: 'images/*.{png,gif,jpg,jpeg}',
                dest: 'dist',
            }]
        },
    },

    clean: {
        build:{
            src: ['dist/']
        }
    },

    uglify: {
        dist: {}
    },

    filerev: {
        options: {
            encoding: 'utf-8',
            algorith: 'md5',
            length: 20
        },
    
    release: {
        // filerev: release hashes(md5) all assets (images, js and css )
        // in dist directory
            files: [{
                src: [
                    'dist/js*.js',
                    'dist/css/*.css',
                ]
            }]
        }
    },

    concat: {
        options: {
            separator: ';'
        },
        dist: {}
    },

    useminprepare: {
        foo: {
            dest: 'dist',
            src: ['index.html', 'about.html', 'precios.html', 'contactanos.html', 'Términosycondiciones.html'],
        },
        options: {
            flow: {
                steps: {
                    css: ['cssmin'],
                    js: ['uglify'],
                },
                post: {
                    css: [{
                        name: 'cssmin',
                        createConfig: function(context, block){
                            var generated = context.options.generated;
                            generated.options ={
                                keepSpecialComments: 0,
                                rebase: false
                            }
                        }
                    }]
                }
            }
        }
    },

    usemin: {
        html: ['dist/index.html', 'dist/about.html', 'dist/precios.html', 'dist/contactanos.html', 'dist/Términosycondiciones.html'],
        options: {
            assetDir: ['dist', 'dist/css', 'dist/js'],
        }
    }
});

grunt.registerTask('css',['sass']);
grunt.registerTask('default', ['browserSync', 'watch']);
grunt.registerTask('img:compress', ['imagemin']);
grunt.registerTask('build', [
    'clean', 
    'copy',
    'imagemin',
    'UseminPrepare',
    'concat',
    'cssmin',
    'uglify',
    'filerev',
    'usemin',
])

};

Please somebody help me

@judolski
Copy link

judolski commented Jul 2, 2022

The "P" in useminPrepare should be capitalized

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants