Skip to content

Commit

Permalink
[webpack] Do not generate filenames with underscores
Browse files Browse the repository at this point in the history
  • Loading branch information
nbloomf committed Nov 22, 2024
1 parent b8c5f58 commit 6f7b64e
Show file tree
Hide file tree
Showing 11 changed files with 18,277 additions and 1,307 deletions.
2 changes: 1 addition & 1 deletion assets/js/stripe-payment-request.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion assets/js/stripe.min.js

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public function __construct() {
}

public function register_payments_scripts() {
$payment_gateways_script_asset_path = WC_STRIPE_PLUGIN_PATH . '/build/payment_gateways.asset.php';
$payment_gateways_script_asset_path = WC_STRIPE_PLUGIN_PATH . '/build/payment-gateways.asset.php';
$payment_gateways_script_asset = file_exists( $payment_gateways_script_asset_path )
? require_once $payment_gateways_script_asset_path
: [
Expand All @@ -38,7 +38,7 @@ public function register_payments_scripts() {

wp_register_script(
'woocommerce_stripe_payment_gateways_page',
plugins_url( 'build/payment_gateways.js', WC_STRIPE_MAIN_FILE ),
plugins_url( 'build/payment-gateways.js', WC_STRIPE_MAIN_FILE ),
$payment_gateways_script_asset['dependencies'],
$payment_gateways_script_asset['version'],
true
Expand All @@ -49,7 +49,7 @@ public function register_payments_scripts() {
);
wp_register_style(
'woocommerce_stripe_payment_gateways_page',
plugins_url( 'build/payment_gateways.css', WC_STRIPE_MAIN_FILE ),
plugins_url( 'build/payment-gateways.css', WC_STRIPE_MAIN_FILE ),
[ 'wc-components' ],
$payment_gateways_script_asset['version']
);
Expand Down
6 changes: 3 additions & 3 deletions includes/admin/class-wc-stripe-settings-controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ public function admin_scripts( $hook_suffix ) {
$suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';

// Webpack generates an assets file containing a dependencies array for our built JS file.
$script_asset_path = WC_STRIPE_PLUGIN_PATH . '/build/upe_settings.asset.php';
$script_asset_path = WC_STRIPE_PLUGIN_PATH . '/build/upe-settings.asset.php';
$script_asset = file_exists( $script_asset_path )
? require $script_asset_path
: [
Expand All @@ -139,14 +139,14 @@ public function admin_scripts( $hook_suffix ) {

wp_register_script(
'woocommerce_stripe_admin',
plugins_url( 'build/upe_settings.js', WC_STRIPE_MAIN_FILE ),
plugins_url( 'build/upe-settings.js', WC_STRIPE_MAIN_FILE ),
$script_asset['dependencies'],
$script_asset['version'],
true
);
wp_register_style(
'woocommerce_stripe_admin',
plugins_url( 'build/upe_settings.css', WC_STRIPE_MAIN_FILE ),
plugins_url( 'build/upe-settings.css', WC_STRIPE_MAIN_FILE ),
[ 'wc-components' ],
$script_asset['version']
);
Expand Down
6 changes: 3 additions & 3 deletions includes/class-wc-stripe-blocks-support.php
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ public function get_payment_method_script_handles() {
* Registers the UPE JS scripts.
*/
private function register_upe_payment_method_script_handles() {
$asset_path = WC_STRIPE_PLUGIN_PATH . '/build/upe_blocks.asset.php';
$asset_path = WC_STRIPE_PLUGIN_PATH . '/build/upe-blocks.asset.php';
$version = WC_STRIPE_VERSION;
$dependencies = [];
if ( file_exists( $asset_path ) ) {
Expand All @@ -125,14 +125,14 @@ private function register_upe_payment_method_script_handles() {

wp_enqueue_style(
'wc-stripe-blocks-checkout-style',
WC_STRIPE_PLUGIN_URL . '/build/upe_blocks.css',
WC_STRIPE_PLUGIN_URL . '/build/upe-blocks.css',
[],
$version
);

wp_register_script(
'wc-stripe-blocks-integration',
WC_STRIPE_PLUGIN_URL . '/build/upe_blocks.js',
WC_STRIPE_PLUGIN_URL . '/build/upe-blocks.js',
array_merge( [ 'stripe' ], $dependencies ),
$version,
true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ public function scripts() {
return;
}

$asset_path = WC_STRIPE_PLUGIN_PATH . '/build/express_checkout.asset.php';
$asset_path = WC_STRIPE_PLUGIN_PATH . '/build/express-checkout.asset.php';
$version = WC_STRIPE_VERSION;
$dependencies = [];
if ( file_exists( $asset_path ) ) {
Expand All @@ -295,15 +295,15 @@ public function scripts() {
wp_register_script( 'stripe', 'https://js.stripe.com/v3/', '', '3.0', true );
wp_register_script(
'wc_stripe_express_checkout',
WC_STRIPE_PLUGIN_URL . '/build/express_checkout.js',
WC_STRIPE_PLUGIN_URL . '/build/express-checkout.js',
array_merge( [ 'jquery', 'stripe' ], $dependencies ),
$version,
true
);

wp_enqueue_style(
'wc_stripe_express_checkout_style',
WC_STRIPE_PLUGIN_URL . '/build/express_checkout.css',
WC_STRIPE_PLUGIN_URL . '/build/express-checkout.css',
[],
$version
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ public function payment_scripts() {

wp_register_script(
'wc-stripe-upe-classic',
WC_STRIPE_PLUGIN_URL . '/build/upe_classic.js',
WC_STRIPE_PLUGIN_URL . '/build/upe-classic.js',
array_merge( [ 'stripe', 'wc-checkout' ], $dependencies ),
$version,
true
Expand All @@ -348,7 +348,7 @@ public function payment_scripts() {

wp_register_style(
'wc-stripe-upe-classic',
WC_STRIPE_PLUGIN_URL . '/build/upe_classic.css',
WC_STRIPE_PLUGIN_URL . '/build/upe-classic.css',
[],
$version
);
Expand Down
Loading

0 comments on commit 6f7b64e

Please sign in to comment.