WordPress.org

Make WordPress Core

Changeset 51173


Ignore:
Timestamp:
06/16/2021 10:56:32 PM (3 months ago)
Author:
desrosj
Message:

Build/Test Tools: Ignore sourceMaps for non WordPress Core files.

If a custom plugin or theme exists in the build/wp-content directory with a sourcemap, the build` script is currently returning a warning and failing.

This improves the verify:source-maps task in Grunt to ignore directories and files that do not belong to WordPress Core.

Props ryelle, afragen, johnbillion.
Fixes #52689.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Gruntfile.js

    r51016 r51173  
    15471547     */
    15481548    grunt.registerTask( 'verify:source-maps', function() {
    1549         const path = `${ BUILD_DIR }**/*.js`;
    1550         const files = glob.sync( path );
     1549        const files = buildFiles.reduce( ( acc, path ) => {
     1550            // Skip excluded paths and any path that isn't a file.
     1551            if ( '!' === path[0] || '**' !== path.substr( -2 ) ) {
     1552                return acc;
     1553            }
     1554            acc.push( ...glob.sync( `${ BUILD_DIR }/${ path }/*.js` ) );
     1555            return acc;
     1556        }, [] );
    15511557
    15521558        assert(
Note: See TracChangeset for help on using the changeset viewer.