Add a Grunt action to set GP_SCRIPT_DEBUG to false when we deploy to wporg#1697
Merged
Conversation
akirk
reviewed
Sep 25, 2023
Co-authored-by: Alex Kirk <akirk@users.noreply.github.com>
Co-authored-by: Alex Kirk <akirk@users.noreply.github.com>
Co-authored-by: Alex Kirk <akirk@users.noreply.github.com>
The dash introduced with the new name causes problems executing the Grunt task, so we need to add these single quotation marks
Member
Author
With the dash in the Grunt action name, I have problems running the task in my local machine, so I have added single quotation marks to this action name. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
When we deploy a new version to wporg, we need to minify the CSS and the JavaScript tiles.
GP_SCRIPT_DEBUGconstant to load the unminified CSS and JavaScript files by default, setting thisGP_SCRIPT_DEBUGconstant totruein the glotpress.php file.But we need to change the
GP_SCRIPT_DEBUGconstant tofalsebefore we deploy to wporg, so the wporg release will use the minified files (except the end user will use theSCRIPT_DEBUGset totrue). This PR address this problem.Fixes #1587.
Solution
This PR adds:
define( 'GP_SCRIPT_DEBUG', true );todefine( 'GP_SCRIPT_DEBUG', false );in the glotpress.php file. Gruntfile.js file.Testing Instructions
To test this PR:
grunt replace:updateGPScriptDebugConstcommand.npm run updateGPScriptDebugConstcommand.In both situations, you can check that the
GP_SCRIPT_DEBUGvalue in theglotpress.phpfile has changed from true to false.