Changeset 55484
- Timestamp:
- 03/08/2023 01:01:45 AM (20 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Gruntfile.js
r55186 r55484 33 33 '!wp-content/themes/twenty*/node_modules/**', 34 34 ], 35 36 // All built CSS files, in /src or /build. 37 cssFiles = [ 38 'wp-admin/css/*.min.css', 39 'wp-admin/css/*-rtl*.css', 40 'wp-includes/css/*.min.css', 41 'wp-includes/css/*-rtl*.css', 42 'wp-admin/css/colors/**/*.css', 43 'wp-includes/blocks/**/*.css', 44 ], 45 46 // All built js files, in /src or /build. 47 jsFiles = [ 48 'wp-admin/js/', 49 'wp-includes/js/', 50 'wp-includes/blocks/**/*.js', 51 'wp-includes/blocks/**/*.js.map', 52 ], 53 54 // All files built by Webpack, in /src or /build. 55 webpackFiles = [ 56 'wp-includes/assets/*', 57 'wp-includes/css/dist', 58 '!wp-includes/assets/script-loader-packages.min.php', 59 ], 60 61 // Prepend `dir` to `file`, and keep `!` in place. 62 setFilePath = function( dir, file ) { 63 if ( '!' === file.charAt( 0 ) ) { 64 return '!' + dir + file.substring( 1 ); 65 } 66 67 return dir + file; 68 }, 35 69 changedFiles = { 36 70 php: [] … … 108 142 plugins: [BUILD_DIR + 'wp-content/plugins'], 109 143 themes: [BUILD_DIR + 'wp-content/themes'], 144 145 // Clean the files from /build and the JS, CSS, and Webpack files from /src. 110 146 files: buildFiles.concat( [ 111 147 '!wp-config.php', 112 148 ] ).map( function( file ) { 113 if ( '!' === file.charAt( 0 ) ) { 114 return '!' + BUILD_DIR + file.substring( 1 ); 115 } 116 return BUILD_DIR + file; 149 return setFilePath( BUILD_DIR, file ); 150 } ).concat( 151 cssFiles.map( function( file ) { 152 return setFilePath( SOURCE_DIR, file ); 153 } ) 154 ).concat( 155 jsFiles.map( function( file ) { 156 return setFilePath( SOURCE_DIR, file ); 157 } ) 158 ).concat( 159 webpackFiles.map( function( file ) { 160 return setFilePath( SOURCE_DIR, file ); 161 } ) 162 ), 163 164 // Clean built JS, CSS, and Webpack files from either /src or /build. 165 css: cssFiles.map( function( file ) { 166 return setFilePath( WORKING_DIR, file ); 117 167 } ), 118 css: [ 119 WORKING_DIR + 'wp-admin/css/*.min.css', 120 WORKING_DIR + 'wp-admin/css/*-rtl*.css', 121 WORKING_DIR + 'wp-includes/css/*.min.css', 122 WORKING_DIR + 'wp-includes/css/*-rtl*.css', 123 WORKING_DIR + 'wp-admin/css/colors/**/*.css' 124 ], 125 js: [ 126 WORKING_DIR + 'wp-admin/js/', 127 WORKING_DIR + 'wp-includes/js/' 128 ], 129 'webpack-assets': [ 130 WORKING_DIR + 'wp-includes/assets/*', 131 WORKING_DIR + 'wp-includes/css/dist/', 132 '!' + WORKING_DIR + 'wp-includes/assets/script-loader-packages.min.php' 133 ], 168 js: jsFiles.map( function( file ) { 169 return setFilePath( WORKING_DIR, file ); 170 } ), 171 'webpack-assets': webpackFiles.map( function( file ) { 172 return setFilePath( WORKING_DIR, file ); 173 } ), 134 174 dynamic: { 135 175 dot: true, … … 238 278 ], 239 279 dest: WORKING_DIR + 'wp-includes/js/jquery/' 240 }, 241 { 280 } 281 ].concat( 282 // Copy tinymce.js only when building to /src. 283 WORKING_DIR === SOURCE_DIR ? { 242 284 expand: true, 243 285 cwd: SOURCE_DIR + 'js/_enqueues/vendor/tinymce/', 244 286 src: 'tinymce.js', 245 287 dest: SOURCE_DIR + 'wp-includes/js/tinymce/' 246 }, 247 248 ] 288 } : [] 289 ) 249 290 }, 250 291 'admin-js': {
Note: See TracChangeset
for help on using the changeset viewer.