10up / generator-wp-make

A Yeoman generator for making WordPress things
184 stars 42 forks source link

Running a new install, Grunt is broken. #69

Closed jtsternberg closed 8 years ago

jtsternberg commented 8 years ago
ERROR
>> SyntaxError: Unexpected token }

This is because of this errant bracket:

concat.js code:

module.exports = {
    options: {
        stripBanners: true,
            banner: '/*! <%= pkg.title %> - v<%= pkg.version %>\n' +
        ' * <%= pkg.homepage %>\n' +
        ' * Copyright (c) <%= grunt.template.today("yyyy") %>;' +
            }' * Licensed GPL-2.0+' +
        ' */\n'
    },
    main: {
        src: [
            'assets/js/src/gathercontent-importer.js'
        ],
            dest: 'assets/js/gathercontent-importer.js'
    }
};

uglify.js code:

module.exports = {
    all: {
        files: {
            'assets/js/gathercontent-importer.min.js': ['assets/js/gathercontent-importer.js']
        },
        options: {
            banner: '/*! <%= pkg.title %> - v<%= pkg.version %>\n' +
            ' * <%= pkg.homepage %>\n' +
            ' * Copyright (c) <%= grunt.template.today("yyyy") %>;' +
            }' * Licensed GPL-2.0+' +
            ' */\n',
            mangle: {
                except: ['jQuery']
            }
        }
    }
};

I haven't yet confirmed if other files have the same problem.

jtsternberg commented 8 years ago

cssmin.js as well. This line: https://github.com/10up/generator-wp-make/blob/master/shared/grunt/tasks/options/_concat.js#L7

<% if ( opts.license ) { %>}' * Licensed <%= opts.license %>' +<% } %>

Should be

<% if ( opts.license ) { %>' * Licensed <%= opts.license %>' +<% } %>