[wp-trac] [WordPress Trac] #48154: Build Tools: Integrate DependencyExtractionWebpackPlugin in the JS build

WordPress Trac noreply at wordpress.org
Sun Mar 1 23:49:02 UTC 2020


#48154: Build Tools: Integrate DependencyExtractionWebpackPlugin in the JS build
-------------------------------------+-------------------------
 Reporter:  gziolo                   |       Owner:  gziolo
     Type:  defect (bug)             |      Status:  reopened
 Priority:  normal                   |   Milestone:  5.4
Component:  Script Loader            |     Version:
 Severity:  normal                   |  Resolution:
 Keywords:  needs-patch 2nd-opinion  |     Focuses:  javascript
-------------------------------------+-------------------------
Changes (by azaozz):

 * keywords:  needs-patch => needs-patch 2nd-opinion


Comment:

 Replying to [comment:69 SergeyBiryukov]:
 > If the file is different based on whether it's created in "build" or
 "dev" mode, should it really be in SVN?

 Yeah, been trying to wrap my head around this for a while... Seems I was
 incorrect about how this happened. Looking again, the conflict happened in
 [47377] and the three extra files were created in the develop repo. Then
 they were copied to the build repo in [47380] when I removed the copy
 restriction in Grunt.

 "Unversioning" `script-loader-packages.php` and setting `wp-
 includes/assets` back to "ignored" will prevent merge conflicts like this
 one in the future, but will bring back the above mentioned build problems:
 the file is missing in /build when running `npm run dev` or `grunt watch`,
 and in /src when running `npm run build` or `grunt build`, etc.

 This seems to mostly affect running the unit tests after `npm run build`.
 Wondering if adding a "doing it wrong" when that file is missing would be
 a good way to handle this error. Perhaps something like:

 {{{
 if ( ! file_exists( $assets_file ) ) {
     $message = __( 'It apperas that WordPress was not build properly or is
 running from the wrong directory. The <code>wp-includes/assets/script-
 loader-packages.php</code> file is missing.' );
     _doing_it_wrong( __FUNCTION__, $message, '5.4.0' );
     return;
 }
 }}}

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/48154#comment:70>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list