gruntfile.js
function wrapDefine( src, path ){

        path = path.replace('src/', '');

        var deps = ['physicsjs'];
        var l = path.split('/').length;
        var pfx = l > 0 ? (new Array( l )).join('../') : './';
        src.replace(/@requires\s([\w-_\/]+(\.js)?)/g, function( match, dep ){

            var i = dep.indexOf('.js');

            if ( i > -1 ){
                // must be a 3rd party dep
                dep = dep.substr( 0, i );
                deps.push( dep );
            } else {
                // just get the dependency
                deps.push( pfx + dep );
            }
            // no effect
            return match;
        });

        var data = {
            src: src.replace(/\n/g, '\n    '),
            path: path,
            deps: deps
        };

        return grunt.template.process(config.banner, config) +
            grunt.template.process(config.extensionWrapper, {data: data});
    }
function wrapDefine( src, path ){

        path = path.replace('src/', '');

        var deps = ['physicsjs'];
        var l = path.split('/').length;
        var pfx = l > 0 ? (new Array( l )).join('../') : './';
        src.replace(/@requires\s([\w-_\/]+(\.js)?)/g, function( match, dep ){

            var i = dep.indexOf('.js');

            if ( i > -1 ){
                // must be a 3rd party dep
                dep = dep.substr( 0, i );
                deps.push( dep );
            } else {
                // just get the dependency
                deps.push( pfx + dep );
            }
            // no effect
            return match;
        });

        var data = {
            src: src.replace(/\n/g, '\n    '),
            path: path,
            deps: deps
        };

        return grunt.template.process(config.banner, config) +
            grunt.template.process(config.extensionWrapper, {data: data});
    }
function wrapDefine ( src , path ) { path = path . replace ( 'src/' , '' ) ; var deps = [ 'physicsjs' ] ; var l = path . split ( '/' ) . length ; var pfx = l > 0 ? ( new Array ( l ) ) . join ( '../' ) : './' ; src . replace ( / @requires\s([\w-_\/]+(\.js)?) / g , function ( match , dep ) { var i = dep . indexOf ( '.js' ) ; if ( i > - 1 ) { // must be a 3rd party dep dep = dep . substr ( 0 , i ) ; deps . push ( dep ) ; } else { // just get the dependency deps . push ( pfx + dep ) ; } // no effect return match ; } ) ; var data = { src : src . replace ( / \n / g , '\n    ' ) , path : path , deps : deps } ; return grunt . template . process ( config . banner , config ) + grunt . template . process ( config . extensionWrapper , { data : data } ) ; }
search for pragmas to figure out dependencies and add a umd declaration
search for pragmas to figure out dependencies and add a umd declaration