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

Adding new Map visitor #5

Closed
wants to merge 1 commit into from

Conversation

marclaval
Copy link
Contributor

Adds a new visitor which creates a map of the non AT files which have been minified nd hashed.
Sample of map:
{"toto.js": "toto-48fe15e40d5443a4048317394b8bd0ea.js", "js/jquery.js": "js/jquery-54654165165165gfsdg6fsd51g.js"}

Here is an ATPacager configuration sample using this new visitor:

grunt.config.set('atpackager.prod', {
        options : {
            sourceDirectories : ['js'],
            sourceFiles : ['rt/**/*', 'grunt/**/*'],
            outputDirectory : 'output',
            visitors : [{
                type : 'JSMinify',
                cfg : {
                    files : ['**/*.js']
                }
            }, {
                type : 'Hash',
                cfg : {
                    files : ['**/*.js']
                }
            }, {
                type : 'Map',
                cfg : {
                    mapFile : 'map.json',
                    sourceFiles : ['**/*.js'],
                    outputDirectory : 'target'
                }
            }, {
                type : 'CopyUnpackaged',
                cfg : {
                    files : ['**/*.js'],
                    builder : {
                        type : 'Concat'
                    }
                }
            }]
        }
    });

}
var urlMapString = JSON.stringify(map, null, this.jsonIndent);
var outputMap = path.join(this.outputDirectory || packaging.outputDirectory, this.mapFile);
if (this.append && grunt.file.exists(outputMap)) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where is this.append defined?

@marclaval marclaval closed this in b6609a8 Dec 4, 2013
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

Successfully merging this pull request may close these issues.

2 participants