tschaub / grunt-newer

Configure Grunt tasks to run with newer files only.
https://npmjs.org/package/grunt-newer
MIT License
945 stars 61 forks source link

str.replace is not a function #112

Closed gracedigital closed 7 years ago

gracedigital commented 7 years ago

Running the example task: grunt.registerTask('minify', ['newer:uglify:all']); I get the following warning: str.replace is not a function Use --force to continue.

Any suggestions on how to resolve? Not sure if this is a bug in the plugin or not...

Here is my package.json { "name": "myradio", "version": "0.1.0", "devDependencies": { "grunt": "~0.4.5", "grunt-contrib-clean": "^1.0.0", "grunt-contrib-cssmin": "^1.0.2", "grunt-contrib-uglify": "~0.5.0", "grunt-exec": "^1.0.1", "grunt-newer": "^1.2.0" } }

gracedigital commented 7 years ago

Here is the task...

    uglify: {
        options: {
            mangleProperties: false
        },
        dynamic_mappings: {
            // Grunt will search for "**/*.js" under "lib/" when the "uglify" task
            // runs and build the appropriate src-dest file mappings then, so you
            // don't need to update the Gruntfile when files are added or removed.
            files: [{
                force: true,
                expand: true, // Enable dynamic expansion.
                cwd: 'assets/scripts/', // Src matches are relative to this path.
                src: ['**/*.js'], // Actual pattern(s) to match.
                dest: 'assets/scripts/min', // Destination path prefix.
                ext: '.min.js', // Dest filepaths will have this extension.
                extDot: 'first' // Extensions in filenames begin after the first dot
            }, ],
        },
    }

   ....

    grunt.registerTask('default', ['clean', ['newer:uglify:all'], 'cssmin']);
gracedigital commented 7 years ago

Disregard. User error. Needed to remove the brackets for the task ['newer:uglify:all']