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

WordPress Trac noreply at wordpress.org
Tue Jan 28 20:25:19 UTC 2020


#48154: Build Tools: Integrate DependencyExtractionWebpackPlugin in the JS build
-------------------------------------------------+-------------------------
 Reporter:  gziolo                               |       Owner:  gziolo
     Type:  enhancement                          |      Status:  reopened
 Priority:  normal                               |   Milestone:  5.4
Component:  Script Loader                        |     Version:  trunk
 Severity:  normal                               |  Resolution:
 Keywords:  dev-feedback needs-patch 2nd-        |     Focuses:  javascript
  opinion                                        |
-------------------------------------------------+-------------------------

Comment (by gziolo):

 Replying to [comment:32 pbearne]:
 > I wonder if it would not be better to test for the PHP file and not the
 JS as the PHP file is created if the JS is there ( this is less expensive
 than testing for both )

 Yes, it makes a lot of sense. The assumption made previously didn't take
 into account that existing WordPress development codebases have JS files
 already. It's better to verify whether the PHP file exists. Your patch
 proposed in #49311 addresses it properly. Thank you for taking care of it.
 I'd personally be fine with landing it after review and testing.

 > We should/could throw an error message if we are missing a PHP file
 instructing the DEV to run  npm build:dev

 I asked about that in one of my comments above. It would be the preferred
 approach but I don't know how to do it to don't make PHPUnit tests fail
 when they don't run `npm run build:dev`. In many projects, the expectation
 is that you don't to build JS files to run those tests which makes a lot
 of sense.

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


More information about the wp-trac mailing list