Giter Site home page Giter Site logo

Comments (2)

jwvdiermen avatar jwvdiermen commented on August 23, 2024

Sorry, but I'm not able to reproduce this warning. I tried both Windows and Linux (Docker container running the image node:4.2) and ran grunt test, but no warnings about a symbol not being defined.

Any tips on how I can reproduce this? I don't own a mac.

from grunt-include-source.

ahhatem avatar ahhatem commented on August 23, 2024

Hi, I am facing the same issue, I am also on mac.
The problem is in the "extendr" class. When I commented/disabled, things worked correctly.
I managed to make it work by changing the file to the following:

           options.target = this.target;
            grunt.log.debug('Ahhatem: before adding the type mapping');

            //var typeMappings = extendr.clone(defaultTypeMappings);
            var typeMappings = defaultTypeMappings;

            grunt.log.debug('Ahhatem: after adding the type mapping');
            //extendr.extend(typeMappings, options.typeMappings);
            //extendr.extend(typeMappings, options.typeMappings);
            grunt.log.debug('Ahhatem: after extending the type mapping');

            grunt.log.debug('Base path is "' + options.basePath + '".');

            // Iterate over all specified file groups.
            this.files.forEach(function(file) {
                    grunt.log.debug('Handling output file "' + file.dest + "'...");

                    // Concatenate the source files.
                    var contents = '';
                    var contentSources = file.src.filter(function(filePath) {
                                    grunt.log.debug('Using input file "' + filePath + '".');
                                    // Remove nonexistent files.
                                    if (!grunt.file.exists(filePath)) {
                                            grunt.log.warn('Source file "' + filePath + '" not found.');
                                            return false;
                                    } else {
                                            return true;
                                    }
                            }).map( function(filePath) {
                                    // Read and return the file's source.
                                    return grunt.file.read(filePath);
                            });

                    // Don't bother detecting newline if we have no more than 1 file.
                    if (contentSources.length > 1) {
                            // Detect the newline to use for the content files.
                            // Use the first file to detect the newlines, no use to test all of them.
                            var contentNewline = /\r\n/g.test(contentSources[0]) ? '\r\n' : '\n';

                            // Join the content files as one to be processed.
                            contents = contentSources.join(contentNewline);
                    }
                    else {
                            // Still use join here, since 'contentSources' could have a length of 0?
                            contents = contentSources.join();
                    }

                    // Parse the contents, using a parser based on the target file.
                    var fileType = path.extname(file.dest).substr(1);
                    grunt.log.debug('File type is "' + fileType + '"');

                    // Try and map the file type, using it instead.
                    var mappedFileType = typeMappings[fileType];
                    if (mappedFileType) {
                            grunt.log.debug('File type "' + fileType + '" maps to "' + mappedFileType + '"');
                            fileType = mappedFileType;
                    }

                    var parserFn = parsers[fileType];
                    var findEndMarker = endMarkerParsers[fileType];

                    if (!parserFn) {
                            grunt.log.error('No parser found found file type "' + fileType + '".');
                            return false;
                    }

                    // Get the available templates.
                    var localTemplates = templates;
                    //extendr.safeDeepExtendPlainObjects(localTemplates, options.templates);
                    var typeTemplates = localTemplates[fileType];

from grunt-include-source.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.