Make WordPress Core


Ignore:
Timestamp:
02/14/2019 12:06:39 AM (6 years ago)
Author:
peterwilsoncc
Message:

Build: Remove source map from jquery.form.min.js.

Minimize jquery.form.js as part of build process to remove the source map reference.

Modify source map tests to include all JavaScript files rather than testing Backbone and jQuery only.

Props pento.
Fixes #46218.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/dependencies/scripts.php

    r44403 r44740  
    13421342        );
    13431343    }
     1344
     1345    function test_no_source_mapping() {
     1346        $all_files = new RecursiveIteratorIterator( new RecursiveDirectoryIterator( dirname( ABSPATH ) . '/build/' ) );
     1347        $js_files  = new RegexIterator( $all_files, '/\.js$/' );
     1348        foreach( $js_files as $js_file ) {
     1349            $contents = trim( file_get_contents( $js_file ) );
     1350
     1351            // We allow data: URLs.
     1352            $found = preg_match( '/sourceMappingURL=((?!data:).)/', $contents );
     1353            $this->assertSame( $found, 0, "sourceMappingURL found in $js_file" );
     1354        }
     1355    }
    13441356}
Note: See TracChangeset for help on using the changeset viewer.