gulpfile.js
async function buildSrcCheckMinifiedSizeTask() {
	const stats = await fs.stat( './dist/Autolinker.min.js' );
	const sizeInKb = stats.size / 1000;
	const maxExpectedSizeInKb = 46;
	
	if( sizeInKb > maxExpectedSizeInKb ) {
		throw new Error( `
			Minified file size of ${sizeInKb.toFixed( 2 )}kb is greater than max 
			expected minified size of ${maxExpectedSizeInKb}kb
			
			This check is to make sure that a dependency is not accidentally 
			added which significantly inflates the size of Autolinker. If 
			additions to the codebase have been made though and a higher size 
			is expected, bump the 'maxExpectedSizeInKb' number in gulpfile.js
		`.trim().replace( /^\t*/gm, '' ) );
	}
}
async function buildSrcCheckMinifiedSizeTask() {
	const stats = await fs.stat( './dist/Autolinker.min.js' );
	const sizeInKb = stats.size / 1000;
	const maxExpectedSizeInKb = 46;
	
	if( sizeInKb > maxExpectedSizeInKb ) {
		throw new Error( `
			Minified file size of ${sizeInKb.toFixed( 2 )}kb is greater than max 
			expected minified size of ${maxExpectedSizeInKb}kb
			
			This check is to make sure that a dependency is not accidentally 
			added which significantly inflates the size of Autolinker. If 
			additions to the codebase have been made though and a higher size 
			is expected, bump the 'maxExpectedSizeInKb' number in gulpfile.js
		`.trim().replace( /^\t*/gm, '' ) );
	}
}
async function buildSrcCheckMinifiedSizeTask ( ) { const stats = await fs . stat ( './dist/Autolinker.min.js' ) ; const sizeInKb = stats . size / 1000 ; const maxExpectedSizeInKb = 46 ; if ( sizeInKb > maxExpectedSizeInKb ) { throw new Error ( ` ${ sizeInKb . toFixed ( 2 ) } ${ maxExpectedSizeInKb } ` . trim ( ) . replace ( / ^\t* / gm , '' ) ) ; } }
Checks that we don't accidentally add an extra dependency that bloats the
minified size of Autolinker
Checks that we don t accidentally add an extra dependency that bloats the minified size of Autolinker