[wp-trac] [WordPress Trac] #51966: npm/grunt watch/build task names are inconsistent and unintuitive
WordPress Trac
noreply at wordpress.org
Wed Dec 9 10:54:51 UTC 2020
#51966: npm/grunt watch/build task names are inconsistent and unintuitive
-----------------------------------+-------------------------------
Reporter: iandunn | Owner: (none)
Type: enhancement | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Build/Test Tools | Version: 5.1
Severity: normal | Resolution:
Keywords: has-patch 2nd-opinion | Focuses: javascript, docs
-----------------------------------+-------------------------------
Changes (by azaozz):
* keywords: has-patch => has-patch 2nd-opinion
Comment:
> I often have trouble getting the right watch or build command going,
because they don't seem intuitive or consistent to me.
Same here :)
Frankly I'm thinking the whole "build in one of two places" setup is quite
confusing especially for new contributors. Even more when trying to run
the tests. Where are they actually running from, `build` or `src`, or...
sometimes from here, other times from there..? :)
Even more confusing/error prone is when doing `svn up` followed by `grunt
build`. Then the old, outdated build files are still left in `/src`. So if
you happen to run WP or tests from `/src` you end up with a mixture of old
"built" files (js, css, and some php) mixed with new source files. A
mess...
The patch at https://github.com/WordPress/wordpress-develop/pull/798 looks
good and makes it easier/better. The inline docs will help too. Thinking
it shouldn't stop there though.
Seems the best way to fix the above "mess" would be to always build in
both places, `build` and `src`. That may be a bit slower, but will
simplify a lot of things and prevent a lot of confusion and headaches.
Actually it looks like it won't be slower, can build to `src` and then
copy all built files to `build`. Looking at Gruntfile.js this is pretty
easy to do there but will need to fix/tweak Webpack a bit.
Do you think this is a good idea? If we do that, then we can
change/simplify/deprecate a lot more of the build commands.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/51966#comment:2>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list