Respect SCRIPT_DEBUG
in released plugin versions
#1026
Labels
[Type] Build Tooling
Issues or PRs related to build tooling
SCRIPT_DEBUG
in released plugin versions
#1026
When we release plugin versions, we should allow people to debug our JavaScript using the
SCRIPT_DEBUG
constant. This constant is defined and used by core, but it's nice to support it in plugins also.This is currently working for vendor JavaScript code like React and Moment.js, since we load the minified or non-minified versions of these files based on the value of this constant. However, it's not working for our own JavaScript code because we always build to and load from the same set of files, regardless of whether they are minified or not.
This means that currently:
The behavior during plugin development is probably what we want; however, we should bundle both the development (unminified) and production (minified) versions of our JS and CSS with the plugin, like we do for vendor files.
In order to achieve this we'll need to add a
npm run build-dev
command that writes to a separate set of files, and modify the plugin logic for release mode only to load either of these sets of files based onSCRIPT_DEBUG
.This will also give us a way to allow users to enable the Save button themselves during early releases: just enable
SCRIPT_DEBUG
on their WP install. See #748.The text was updated successfully, but these errors were encountered: