packages/babel-plugin-minify-simplify/src/index.js
function(path) {
            const { node } = path;

            if (node.declarations.length < 2) {
              return;
            }

            const inits = [];
            const empty = [];
            for (const decl of node.declarations) {
              if (!decl.init) {
                empty.push(decl);
              } else {
                inits.push(decl);
              }
            }

            // This is based on exprimintation but there is a significant
            // imrpovement when we place empty vars at the top in smaller
            // files. Whereas it hurts in larger files.
            if (this.fitsInSlidingWindow) {
              node.declarations = empty.concat(inits);
            } else {
              node.declarations = inits.concat(empty);
            }
          }
function(path) {
            const { node } = path;

            if (node.declarations.length < 2) {
              return;
            }

            const inits = [];
            const empty = [];
            for (const decl of node.declarations) {
              if (!decl.init) {
                empty.push(decl);
              } else {
                inits.push(decl);
              }
            }

            // This is based on exprimintation but there is a significant
            // imrpovement when we place empty vars at the top in smaller
            // files. Whereas it hurts in larger files.
            if (this.fitsInSlidingWindow) {
              node.declarations = empty.concat(inits);
            } else {
              node.declarations = inits.concat(empty);
            }
          }
function ( path ) { const { node } = path ; if ( node . declarations . length < 2 ) { return ; } const inits = [ ] ; const empty = [ ] ; for ( const decl of node . declarations ) { if ( ! decl . init ) { empty . push ( decl ) ; } else { inits . push ( decl ) ; } } // This is based on exprimintation but there is a significant // imrpovement when we place empty vars at the top in smaller // files. Whereas it hurts in larger files. if ( this . fitsInSlidingWindow ) { node . declarations = empty . concat ( inits ) ; } else { node . declarations = inits . concat ( empty ) ; } }
Put vars with no init at the top.
Put vars with no init at the top .