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

str.replace is not a function #112

Closed
gracedigital opened this issue Dec 30, 2016 · 2 comments
Closed

str.replace is not a function #112

gracedigital opened this issue Dec 30, 2016 · 2 comments

Comments

@gracedigital
Copy link

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
Copy link
Author

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
Copy link
Author

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

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

1 participant