Skip to content

Commit

Permalink
chore: add comments related to the compiled assets files
Browse files Browse the repository at this point in the history
  • Loading branch information
glaubersilva committed Apr 12, 2024
1 parent a6abb8d commit 54df761
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion src/FormExtension/FormBuilder/Actions/LoadFormBuilderAssets.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,29 @@ class LoadFormBuilderAssets
*/
public function __invoke()
{
$assets = ScriptAsset::get(trailingslashit(ADDON_CONSTANT_URL) . '/build/GiveAddonFormBuilderExtension.asset.php');
/**
* This global path refers to the compiled version of the 'FormExtension/FormBuilder/resources/css/index.scss' style
*/
$globalStylePath = trailingslashit(ADDON_CONSTANT_URL) . 'build/GiveAddonFormBuilderExtensionGlobalStyle.css';

/**
* This path refers to the compiled version of the '.module.scss' files present in the 'FormExtension/FormBuilder/resources/js/index.tsx' script
*
* When the 'FormExtension/FormBuilder/resources/js/index.tsx' file loads some component that uses '.module.scss'
* and it gets compiled with WP Scripts, then a .js file is generated in the build folder alongside a style file
* with the same entry name but with the .css extension.
*/
$stylePath = trailingslashit(ADDON_CONSTANT_URL) . 'build/GiveAddonFormBuilderExtension.css';

/**
* This global path refers to the compiled version of the 'FormExtension/FormBuilder/resources/js/index.tsx' script
*/
$scriptPath = trailingslashit(ADDON_CONSTANT_URL) . 'build/GiveAddonFormBuilderExtension.js';



$assets = ScriptAsset::get(trailingslashit(ADDON_CONSTANT_URL) . '/build/GiveAddonFormBuilderExtension.asset.php');

if (file_exists($globalStylePath)) {
wp_enqueue_style(
'givewp-form-extension-ADDON_ID-global-style',
Expand Down

0 comments on commit 54df761

Please sign in to comment.