[wp-trac] [WordPress Trac] #45535: Unminified react and react-dom
WordPress Trac
noreply at wordpress.org
Sat Dec 8 10:08:35 UTC 2018
#45535: Unminified react and react-dom
---------------------------+-----------------------------
Reporter: emilushi | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Script Loader | Version: 5.0
Severity: normal | Keywords: needs-patch
Focuses: javascript |
---------------------------+-----------------------------
Even if you define `SCRIPT_DEBUG` to `true` React and React-Dom are loaded
minified and based on my inspection that is caused `$dev_suffix` on line
79 of `wp-includes/script-loader.php`.
The `wp_scripts_get_suffix()` will always return `.min` if passed
arguments is equal to `dev`. As seen on line 757 of `wp-includes/script-
loader.php` the `wp_scripts_get_suffix()` is setting `$develop_src` to
`false` if `$wp_version` doesn't contain string `-src` for which I don't
know why `$wp_version` will have to contain that string.
I wanted to fix it but I din't understand this part: `$develop_src = false
!== strpos( $wp_version, '-src' )`, why `$develop_src` is depended on
`$wp_version`.
Personally I think it should be depended on `SCRIPT_DEBUG` constant.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/45535>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list