var fs = require( "fs" ),
requirejs = require( "requirejs" ),
slimBuildFlags = require( "./lib/slim-build-flags" ),
- Insight = require( "insight" ),
- pkg = require( "../../package.json" ),
srcFolder = __dirname + "/../../src/",
rdefineEnd = /\}\s*?\);[^}\w]*$/,
read = function( fileName ) {
), [] )
.join( ":" ) :
- "",
- done = this.async(),
- insight = new Insight( {
- trackingCode: "UA-1076265-4",
- pkg: pkg
- } );
-
- function exec( trackingAllowed ) {
- var tracks = args.length ? args[ 0 ].split( "," ) : [];
- var defaultPath = [ "build", "custom" ];
-
- tracks = tracks.map( function( track ) {
- return track.replace( /\//g, "+" );
- } );
-
- if ( trackingAllowed ) {
-
- // Track individuals
- tracks.forEach( function( module ) {
- var path = defaultPath.concat( [ "individual" ], module );
-
- insight.track.apply( insight, path );
- } );
-
- // Track full command
- insight.track.apply( insight, defaultPath.concat( [ "full" ], tracks ) );
- }
-
- grunt.task.run( [ "build:*:*" + ( modules ? ":" + modules : "" ), "uglify", "dist" ] );
- done();
- }
+ "";
grunt.log.writeln( "Creating custom build...\n" );
-
- // Ask for permission the first time
- if ( insight.optOut === undefined ) {
- insight.askPermission( null, function( _error, result ) {
- exec( result );
- } );
- } else {
- exec( !insight.optOut );
- }
+ grunt.task.run( [ "build:*:*" + ( modules ? ":" + modules : "" ), "uglify", "dist" ] );
} );
};